lunes, 3 de noviembre de 2014

install ownCloud on Ubuntu

ownCloud is one of the best file storage and private cloud opensource project available. In  a next POST I will explain the benefits. Meanwhile these are the steps to install it on Debian and Ubuntu:

1. install apache2, php and mysql

2. install these complements:
  sudo apt-get install php5-gd php-xml-parser php5-intl smbclient curl php5-curl

3. enable these 2 modules on apache:
  sudo a2enmod rewrite
  sudo a2enmod headers

4. modify the 'default' config file:
  sudo nano /etc/apache2/sites-available/default

5. inside this file look for the line : '', inside this directory definition change the line AllowOverride None for this:
  AllowOverride All

Save it

6.  restart apache:

 sudo service apache2 restart

7. download ownCloud:
   wget http://download.owncloud.org/community/owncloud-latest.tar.bz2

8. decompress it:
  tar -xjf owncloud-latest.tar.bz2

9. move the directory to 'www':
  mv owncloud /var/www

10. change the owner's directory:
  sudo chown -R www-data:www-data /var/www/owncloud/

11. let's create a database for owncloud using mysql:
  mysql -u user -p
 create database owncloud;
 grant all on owncloud.* to 'owncloud'@'localhost' identified by 'yourpaasswortdhere';

12. Cool, finally go to a web browser and type:
  localhost/owncloud

13. That's it, just add and admin user and password and you're ready

All the best


 

sábado, 1 de noviembre de 2014

Install Zend Server CE from the repos

THis quick post is about how to install Zend Server Communithy Edition on Debian Based Linux Distros.

1. sudo nano /etc/apat/sources.list and add this line:

  deb http://repos.zend.com/zend-server/deb server non-free

 save it

2. add the repo public key:
  wget  http://repos.zend.com/zend.key -O- | sudo apt-key add -
 wait some minutes until its end

3. update your repos:
  sudo apt-get update

4. Then install Zend Server:

  sudo apt-get install zend-server-ce-php-5.3

Done, now you may go through a Web Broiwser and try it at:

 localhost:10081/ZendServer or https://localhost:10082/ZendServer

Enjoy it

Downgrade a package on Debian Wheezy

Sometimes it would be necessary to use a different package version available from the official repositories of our distro, in this case I'll show how to downgrade PHP from wheezy (5.4.4) to Squeeze (5.3.x)

I've already installed php5.4.x, so the steps are:

1. sudo nano /etc/apt/sources.list, add these lines at the end:

  deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
  deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

  deb http://security.debian.org/ squeeze/updates main contrib non-free
  deb-src http://security.debian.org/ squeeze/updates main contrib non-free

  Save your file

2.  Now, we need to display what packages we have installed and related to php5:
   PHP=$(dpkg -l | grep 5.4.4|awk '{print $2}')

  So, I put the result of the above command inside a temporal variable, I will use it later, you may change the version (5.4.4) for the one you're using, it might be later if you're using testing repo for example

3. Cool, now let's take a look to the result:
 echo $PHP
in my case I got libapache2-mod-php5 php5 php5-cli php5-common

4. Next, I will create some rule preference for apt:
   sudo nano /etc/apt/preferences.d/preferences, and I will add these lines that are related to my current installed packages displayed in the above command:

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Save it

5.  update your repos:
  sudo apt-get update


6. Finally downgrade your packages:
  sudo apt-get install --reinstall $PHP

you should see a screen like this:


Notice that the packages that you displayed using dpkg ($PHP) will be downgraded


If you want you may code a php file with phpinfo() and you'll see something like this:




Regards

install linux headers on Debian Wheezy

This is a relly useful trick, many packages require the installation of linux headers, so these next steps explain the process:

0. open a terminal

1. Display your current kernel release:
  uname -r
 (put an eye on this)

2. Then use this command:
  sudo apt-get install linux-headers-$(uname -r)

 You should see a screen like this:





Just type Y and the process will start and that's all

You might get some errors, pay attention to spaces and if whether you're using repos different for your current channel as well, if you're stuck feel free to contact me

Best

lunes, 27 de octubre de 2014

login as another user in a terminal

This is an useful trick specially when we have specific users for certain services - like app servers-  the idea is to login temporally as another user in a terminal, do whatever you have to do and then logout, so, the steps are:

1. open a terminal
2. type: sudo -u myuser02 zsh
3. whoami

That's it, in this case, I use zsh as another terminal, you may use what you like.

Really useful, at least for me

Best

domingo, 26 de octubre de 2014

deploying Apache2+WebDAV on Ubuntu

WebDAV is a web authoring built into HTTP that allows to share files and work collaborative .

So, To enable it there are several steps, here they are:

1. enable the appropriated modules:
sudo a2enmod dav
sudo a2nemod dav_fs

2. restart apache:
  sudo servide apache2 restart

3. Then we need to create a directory, it would be great whether this one is outside the DocumentRoot directory, i will create it on /home:
  mkdir /home/me/webdav

4. To gain access from web we need to change the owner to www-data
   chown www-data /home/me/webdav

5. Next, we need to password protect the target directory:
  sudo htpasswd -c /etc/apache2/webdav.password me
  sudo chown root:www-data /etc/apache2/webdav.password
  sudo chmod 640 /etc/apache2/webdav.password

6. Cool, now we need to configure apache to use WebDAV, I will modify the default site configuration file:

Alias /webdav /home/me/webdav


   Order allow,deny
  Allow from all



    Options Indexes
    DAV On
    AuthType Basic
    AuthName "webdav"
    AuthUserFile /etc/apache2/webdav.password
    Require valid-user


7. At this time, we may try our advance, so from a web browser type:
    http://localhost/webdav

  You will be asked for a user and a password

 You might try it using a WebDAV client called cadaver, like this:
  cadaver http://localhost/webdav

8. for security reasons, we may disable the Directory Listing (removing the line Options Indexes) and instead, we may create an html file ( it is mandatory to named index.html), like this:



Main Page

this is the first page displayed once the directory listing is off



save it on /home/me/webdav, restart apache and try to access it

Next, I will write about how to use it in a production environment.

Best

sábado, 25 de octubre de 2014

executing commands using sudo without ask for password

Sometimes is annoying write the root password for execute certain commands, specially if you are working on console mode, that's why is really great to custom sudo ( using visudo) in order to avoid the password prompt:

1. open your terminal
2. type sudo visudo
3. then add these lines:

User_Alias MANAGERS = user1, user2

Cmnd_Alias SHUTDOWN = /sbin/reboot, /sbin/halt

4. Then add this line at the end of the file:
MANAGERS ALL = (ALL) NOPASSWD: SHUTDOWN

that's it, save it and try it

At least for me it works putting the NOPASSWD line at the end, I'm not sure if the way SUDO reads this file is from bottom to top, anyway, try it

Best

lunes, 22 de septiembre de 2014

Cool tricks you can try on Google

Those are really cool and interesting tricks you can try on the Google Search Engine, at least for me, these next ones are most useful:

1. calculate tip!
  tool to calculate the fees and tip per person.

2. Books by author name
  easily you do a search about the books of your favorite author

3. Songs by singer name
  I did not try it but I assume it will work as the previous one.

4. 100 usd to "currency name"
    really cool!, there are a lot of currency

5. city to city distance
   try it, it is really cool, unfortunately it did not work on some cities I tried.

there are more of them, you may try them here

Cool, see you



sábado, 20 de septiembre de 2014

ogv to mp4 without codec

This is a great trick, in fact yesterday it saved my life, I had an ogv file generated by gtk-recordmydesktop and I need to convert it to a mp4 file because the user do es not use GNU/Linux, so here it is the command line:

ffmpeg -i firstfile.ogv libx264 -vpre medium -crf 24 -threads 0 -acodec copy secondfile.mp4

As you can see we don't use any codec to export the format and this is really great - and faster- in order to get your file.

I read some howtos using codec such as libfaac but honestly it is not as quick as I need it, the result file was ok, I did not loose video quality and the audio was like the source one.

hope to help

Best


lunes, 15 de septiembre de 2014

enabling debug mode on your android phone

This is a really cool trick, I am developing an android app, the deadline is this next friday -hope can make it!- and tonight I start with the first checklist of test, so I got a bug but I could not see it from LogCat, that is really weird so I thought it was an isolated thing, I decided to try it again and still the same, but this time I read something on the LogCat window:

"Unable to open to open log device '/dev/log/main' no such file or directory"

So I discovered this bug occurs when the Android device turn this off. Googling about this would be some kind of complicated because there are many approaches, so I will show how I fix it, but remember, it is not sure it may work on your Android device:

0. My device is not rooted, it is a Huawei brand
1. dial this number on it:
*#*#2846579#*#*
 2. inmediately it will show a menu with 2 options: MMITest_II and ProjectMenu
3. Choose ProjectMenu
4. then Background Settings
5. Log Settings
6. in Log Switch choose "LOG on"
7. in Log level Setting choose "VERBOSE"
8. reboot your device
 
that's it, next time when you run your android app you will get all error messages from your device on the LogCat Window.
 
really cool ah!
 
Best


martes, 5 de agosto de 2014

speed up your chromebook with 'swap enable' command

Finally I could join many urls into my ChromeOS, I noticed my #Cromebook starts to behavior slowly, in fact I added like 30 tabs, so here is a command to speed up it:

1. from ChromeOS hit Ctrl+Alt+T

2. You'll get a new tab with Chrosh, it is like a gnome-terminal console

3. just type swap-enable

4.  restart your #Chromebook


and that's all, next time, you'll notice the time to load all your tabs is shorter

PS: it is absolutely great to be here again, those past months I was really busy but it was really cool

Best

martes, 15 de abril de 2014

Chromium project removed GTK+ support, it will use Aura instead

Chromium is an open source Web Browser project from Google that has a growing community supporting of it - don't get confuse with Chrome Web Browser, let's say this:  both are siblings, just Chromium is the open source one, when anyone may contribute to it development, many people says it is more secure -, so, latest news from this project is the decision to replace GTK+ support, instead of it, the project will use Aura as it default window manager.

Aura is a cross platform graphical system written for Google Developers and the main goal is to offer rich visual and large scale animations and transitions only just hardware acceleration. So Gtk+ and Aura are cross platform, Gtk+ project has many years of experience in the Linux boxes and Aura is relatively newer and under development, but I guess some of the facts to use Aura would be these:

1. Gtk+ is more difficult to set up for Windows
2. non centralized support
3. lack of documentation
4. years ago I read a comparison between Gtk+ vrs QT and the people describes Gtk+ as a "hodge podge"

So maybe the decision from Google to write a window manager from scratch would be hard to support it at the beginning, but right now it seems to be the best one.

So, for the final user -as you and me- this new gives us the opportunity to have better graphical rendering, rich graph content, faster CAD and 3D if we choose to use Chromium project when Aura is in the stable channel, so put an eye on this.

Finally, if you want to try it on unstable, from a terminal in Linux just type:

sudo apt-get install google-chrome-unstable

More info about Aura here:
http://www.chromium.org/developers/design-documents/aura-desktop-window-manager 

Cheers

viernes, 11 de abril de 2014

Google Keep, a good app for take quick notes

This app looks really nice, for those ones with a ChromeBook you may try Google Keep, it is an app to take notes quickly about what you're thinking o re-thinking -believe me, this is really useful, specially if you're a coder who loves what you do- you download it from the Chrome Store and give it a try.

I have been using WriteBox, it is another great app for this purpose, but I would say Google Keep is some steps forward, specially for it interface, anyway, try them.

Last thing, I heard Keep may be used in GNU/Linux, let me know how it goes.

miércoles, 2 de abril de 2014

re-enable your Broadcom wireless adapter in Ubuntu 12.04

I guess this process should be totally easy, it wouldn't be necessary to use even a command, I guess, but sometimes I don't have the enough time to test things like this. Anyway, I have an HP Ultrabook with a Broadcom BCM4312 Wireless Adapter, Yesterday I turned it off using the physical switch button, some time later I tried to re-enable it using the same button - It has to work, trust me, maybe it is a bug with the driver or anything else- but I failed, so, to re-enable I did this:

1. From a terminal I type:
  sudo rfkill list all

in the list I could see my device is blocked by hardware and software

2. then type:
  rfkill unblock all

 then, push the switch button.

3. again, type:
  sudo rfkill list all

Now, at least for me, I can see the device is just blocked by software, the last step is go to the wireless icon in the right upper corner, right click on it and choose "enable wireless", now you may see your wireless button turns blue and it acquires IP from your access point.

That's it, as I told you before, for sure this is a problem with my card or I had just been missed something, I always read that this card is kind of tricky in GNU/Linux, futhermore it is really old -this laptop has more than 5 years- , but if you have a system like this, it might be helpful

Time to go, see you!

why cmus stops everytime it jumps to the next track

I was working with many things at the same time then suddenly cmus' playlist had been stopped, but I did not pay attention to that. At the next morning the same, if I want to listen a song I have to hit X in every jump, I found that I turned off the option "toggle continue", to re-enable just do this:

1. take a look right now at you right bottom corner (you'll see just an R)

2. now press C (capital c)

3. you'll see a CR at you right bottom corner

4. that's it, now your playlist will continue to the end.

easy, yes, but I still believe cmus needs a control interface.

Cheers

lunes, 31 de marzo de 2014

join several pdfs into one single using pdfunite

This is a simple way to join several pdf files into one single file, using pdfunite in GNU/Linux is really easy, just use this line in your terminal:

  pdfunite file1.pdf  file2.pdf filen.pdf out.pdf

few days ago, I need to do this as faster as I could and it really works, have this in mind ok, you never know

all the best

in words from Claudio Fernandez-Araoz

some days ago, reading an article I found these lines from Claudio Fernandez-Araoz, I found them useful, so here they are, first in spanish:

"la clave del exito depende de tres grandes pilares: crecimiento personal para potenciar aquello que se tiene a nuestro alcance mediante el conocimiento, habilidad para tomar decisiones profesionales acertadas yna vez que se comienza a trabajar e inteligencia y capacidad oportuna para saber tomar las decisiones adecuadas"

And, here they are in English -I'm not a certified translator, so bear with me:

"the key of success is based on three key points: personal development to maximize that you have at your range through knowledge, the proficiency to take right and professional decisions once you started to work and intelligence and seasonable capabilities to take right decisions"


Hope, you find this useful

lunes, 24 de marzo de 2014

cmus, text based player

I guess I used rhythmbox as my default player since last 5 years, even if I'm using Debian or Ubuntu, I faced a problem some months ago, I started to develop android apps using Eclipse with ADT plugin, this software requires a lot of RAM, then I tried to use the built-in emulator to test my progress -I hate that emulator- so my available RAM start to decrease and in general the performance of my laptop, don't get confuse, daily I was working with these windows opened:

1. Eclipse+ADT
2.Firefox or Chromium
3. two or three tabs in gnome-terminal
4. libreoffice - sometimes-
5. Nautilus
6. and rhythmbox

now you understand why the performance started to decrease... but I realize that rhythmbox demands like 10% of my CPU and around 5% of RAM, for a player I guess is a lot!, so I decided to start using cmus, it is a text based player, it runs smoother and it is easier to install it, if you want to install it on Ubuntu and have the basics commands, you may read this: http://www.tecmint.com/install-cmus-music-player-in-linux/ and if you want a detailed list of the commands you may read this:  https://github.com/cmus/cmus/blob/master/Doc/cmus.txt.

As a fact, I benchmarked cmus vrs rhythmbox using top command, the results were:

rhythmbox: 9.5% (CPU) and 4.3% (MEM)
cmus: 2.3% (CPU) and 0.5% (MEM)

cool, isn't it?

I'm not saying who is better, in some cases it is necessary to make some room for all the application you need to run, so at least try it. By the way, if you decided to export your playlist from rhythmbox, you will need to do some work in order to adjust it to cmus, just follow this post from me: http://htamayo.blogspot.com/2014/03/customizing-any-text-file-with-sed.html, it could be useful.

PS: it would be cool to create a friendly console based user interface to cmus, in order to use the multimedia buttons functions from your keyboard, if such thing does not exist, I promise to code it, Iĺl let you know.

Cheers

customizing any text file with sed

Well, this is really helpful, if you start to work with GNU/Linux for every purpose in your computer: could be end user, programming, deploying and administering your server, etc. sooner or later you will need to adjust,customize or update text based files with a lot of lines, in case like those ones, you may use commands like "sed" to achieve your purpose.

This post is not an intro to regular expressions, because a topic like that is really complex, this is just how to change/update a text file with a lot of lines using sed, I suggest you to get a good book about regular expressions or start to google about it, seriously, it is really helpful to know about it.

Cool, imagine that you have a File called 'mylist.txt' with 1000 lines, like this:

File001=/ok/ok1/myfile1.txt
Title001="My first file"
File002=/ok/ok1/myfile2.txt
Title002="My second file"
....

1. How to delete all the lines starting with "Title"? here it is the command:
   sed '/Title/d' mylist.txt -> with this line you'll see the changes just in the console, now, if you want to maket it permanently, just use this one:

  sed -i '/Title/d' mylist.txt

  Then, if you do a cat of mylist.txt, you will notice there is no lines starting with "Title".


2. How may I delete all characters in front of the symbol "="?:
   sed s/=[^=]*$// mylist.txt

3. How may I delete all characters behind of the symbol "="?
   sed 's/.*=//' mylist.txt

4. how may I add a string -/home/work/- at the beginning of all lines?
  sed 's/^/\/home\/work\//' mylist.txt

5. Find all numbers in the lines and remove them?
    sed -e 's/[0-9:=]//g' mylist.txt

That's it, don't remember you can check if the results are the needed, then if you want to make the changes permanently, just add '-i' after 'sed' and that's all.

Hope this may help you some day... at least when you need it.

Cheers

jueves, 20 de marzo de 2014

connect your android mobile device in Ubuntu to use it with Eclipse ADT


If you are developing for Android mobile devices using Eclipse with the ADT plugin, it would be a great idea to try your progress in a real android device -believe me , the Eclipse built-in emulator will drive you crazy- so, to get EclipseADT+Ubuntu+Your device work together try these lines:

1. Open a terminal and prompt to the directory where your Eclipse+ADT is installed
2. if you have already open Eclipse type this:
  sudo ./adb kill-server

3. then, type this:
   sudo ./adb start-server
  you should see some notification lines in the command line that the daemon is been loaded

4. to make sure your device is loaded properly, type this:
adb devices

you should see the ID information of your device

Cool; from know go back to Eclipse and if your Run your project, the apk will be generated and send it to your device and it will be loaded as well, from here you may test it and adjust your code. the process is really smooth, you should work entirely using your device, I did this last two months and I could debug my app project.

Hope this help

Cheers

sábado, 15 de marzo de 2014

one tab extension for Google Chrome, all your tabs into a list

This is a good advice, if you use google chrome and you don't have the needed time to read/answer all the information in a website of your interest, you begin to collect lot of tabs opened, then the performance of your browser start to get down -I passed through this last 2 months I was involved in an agile development of project- so this extension for Google Chrome: #onetab is really useful, just install it from here http://www.one-tab.com/ and when you click on the icon at your upper right all your tabs will be grouped into a list - style page, from it, you may open/close them when you want. Really cool, try it.

Cheers

viernes, 28 de febrero de 2014

oi tudo bem? como vai vocẽ?

tudo joia!  Febraury is finishing, I was really full of things this last 6 weeks, I have a lot of posts in draft I hope to release them during this weekend... anyway, I just come to say hi in english and portuguese as well, I'm taking classes in portuguese for several reasons, brazil has important communities in the IT field so I hope to learn new things, so maybe some posts would be in portuguese as well, specially things related to #Android, #Linux and #security... will see, see youn around

jueves, 16 de enero de 2014

WireFrames Tools for design apps, website etc

Well, those tools are really important, specially if your are in the design phase, currently I'm involving in the design, code and deployment of an application, the team members are not together all time, in fact, this is a project after work, so this is a great opportunity to test them.

Here it is a list of suggested tools, you may try them, I tried those ones:

1. iPhone Mockup, one of the fortress it's web based, so it's very easy to gather the ideas from all the team.

2. Pencil, it's platform free so I tried it on Linux, it's really a powerful tool, maybe if you are looking for something more solid, you may try it.

the rest of them are right here: http://goo.gl/sV9NWE

In fact, I got this list on google+ from this guy: https://plus.google.com/u/0/110885795581982251574/posts

let me know if you have any other suggestions or at least you try any other one from the list.

cheers