Posts Tagged ‘linux’
Synergy between different operating systems

At LeaseWeb, developers like to work on Linux, business people like to work on Apple, but almost everybody runs Windows. One of the reasons it is hard to work without Windows is that our calendar and email system only works well under Windows (it is Microsoft Outlook). I have seen several ways to work around this problem. One is to have multiple computers at the office, one running Windows that can be used as an email and calendar system and another Linux or Apple computer to do the actual work on. Multiple computers means multiple screens, which is also a big plus, but it also means multiple mice and keyboards. And that is something less convenient.
Well, there is an App for that… And it is free and open source! It has the appropriate name “Synergy” and makes your Linux/OSX and Windows play along very well. Download it here. One of your computers becomes the “Server” and the other(s) become the client(s). The server has a keyboard and mouse and if you move the cursor off the screen it automatically appears on the other computers screen and you can continue working with the same mouse and keyboard. The clipboard is conveniently shared as well. The computers use the network to communicate. There is only one very big problem with this nice software and that is that its security is very weak (non-existent). The Synergy wiki says:
“Synergy does not do any authentication or encryption. Any computer can connect to the synergy server if it provides a screen name known to the server, and all data is transferred between the server and the clients unencrypted which means that anyone can, say, extract the key presses used to type a password. Therefore, synergy should not be used on untrusted networks.” – source: http://synergy-foss.org/wiki/Security
So if you use Synergy over the wireless network and you type important passwords, the wireless network encryption is the only thing keeping hackers (hiding in a mini-van in your street) from retrieving those passwords. If you use a cabled network the security risk might a little bit lower. Fortunately you can make it secure, as described in the same wiki, by adding a SSH tunnel for TCP port 28400 from the client to the server. For Windows you can use the Bitvise Tunnelier software or MyEnTunnel (which is a front-end for the less user-friendly PuTTY applicaton) and for OSX you can use the SSH Tunnel Manager. To make this work you have to enable SSH logins on the machine that acts as your Synergy server. If you want to install an SSH server on Linux you can install the “openssh-server” package. On OSX you can find the OpenSSH server under sharing and on Windows you can install the user friendly Bitvise WinSSHD or FreeSSHd.
Conclusion: Synergy… It is a cool tool, but use it responsibly!
5 tips to speed up your PC
If you use your PC professionally on a daily basis you understand how important it is that your computer works as fast as possible. Nobody likes waiting for applications to start or quit, or web pages to load. It is not the value of the time lost, but the frustration the waiting causes that is the actual damage done by slow computers. You could either be rich and throw an insane amount of money at your setup or you can be smart and follow the following 5 tips to speed up your PC setup:
- Get rid of your virus scanner… and Windows.
- Get Linux: Xubuntu is usable and optimized for speed.
- Buy a fast SSD, but disable atime.
- Buy more RAM, but lower swappiness.
- Use Chrome as your browser, that thing is fast!
NB: Be careful with applying the following, because you will get used to this speed and you may not want to work on other computers anymore.
1. Get rid of your virus scanner… and Windows.
On Windows, your virus scanner is constantly scanning every file your system accesses. This is causes your system to slow down significantly. I do not think you should run Windows without a virus scanner, but maybe you should just not run Windows. On other operating systems you may not need a virus scanner. Apple’s OSX or Linux are mostly run without one and this is relatively safe. I honestly do not know why. Maybe because Microsoft Windows has a market share of over 80% while others are below 10% and low market share might cause slow spread (of the virus).
2. Get Linux: Xubuntu is usable and optimized for speed.
So no Windows, but what else can you install on your PC? Linux! NB: If you don’t know what Linux is, then I think you should read this first: Disadvantages of Using Linux. Xubuntu is a Linux distribution that is optimized for speed. Version 12.04 LTS (April 2012 with Long Term Support) has recently been released. It is based on Debian, a distribution that is known for its focus on security. It runs the XFCE window manager, that is lightweight, but also user friendly. Once you start using it you’ll notice it has a nasty bug that makes the Thunar file manager start up very slowly, but this bug has a well documented workaround (on the FAQ it is question #2) and will hopefully get fixed very soon.
3. Buy a fast SSD, but disable atime.
A Solid State Drive is a disk without moving parts. It has no heads to move nor platters to rotate when seeking. This makes access times on these disks a lot lower. Also the throughput is optimized by accessing many storage chips in parallel. Xubuntu is by default using an “ext4″ filesystem which is journaled. One of the features of this file system is that it keeps track of the “last access time” or “atime” in short. This is nice, but it means that every read causes a write as well. Since you in general don’t need this “last access time” you can safely disable it by adding the “noatime” flag (nodiratime is implied) to the partition options of your ext4 partitions in the “/etc/fstab” file (see lifehacker). One of the drawbacks I found is that “Mutt” is not working correctly. But note that whenever you make a backup of your valuable files you will probably also update the atime and confuse Mutt (or any other program that relies on atime).
4. Buy more RAM, but lower swappiness.
More gigabytes of RAM could make your system a lot faster, but only if your system actually uses that memory. By default most Linux systems are configured with a “swappiness” setting of 60. If you have 4 to 8 GB of RAM and you want your system to actually use it as much as it can you might want to reduce the swappiness (I have “vm.swappiness = 0″ in “/etc/sysctl.conf”). If you want to learn more about swap you might want to read “Is it safe to turn swap off permanently? ” and the “SwapFaq“.
5. Use Chrome as your browser, that thing is fast!
I personally still prefer Mozilla Firefox as my primary browser, but whenever I use Google’s Chrome Browser I am blown away by its speed. This might very well be the reason it is worlds most poular browser! It can easily be installed in Xubuntu by typing “sudo apt-get install chromium-browser” in the terminal window. Both Firefox and Chrome support the “Ad Block Plus” addon/extension, that makes your pages a little faster to load (and conveniently removes the ads from almost all pages on the Internet).
Fast Symfony2 served on a stable Xubuntu
Ingredients:
Introduction:
This recipe is for people who want to install symfony2 quickly with all dependencies, without having to read the excellent documentation that can be found here:
This recipe can be used by linux users or by windows users that run linux in a virtual machine.
This will get you:
- A working Symfony2 installation
- Pretty URL’s (using mod_rewrite)
- Optimized execution speed (using php5-apc)
- Configured timezone settings and internationalization support (using php5-intl)
- Run as a specific user and not as www-data (using apache2-mpm-itk)
- Created a database and installed a database management tool (phpmyadmin).
The instructions are meant for a development platform. If you use these instructions on a production platform the least you should do is choose a more secure password. NB: You also might want to run Ubuntu Server instead of Xubuntu in such a case.
This will NOT get you:
- A debugging environment (using XDebug)
- An PHP IDE with debugging integration (Eclipse PDT)
For serious web development you might want the above: a full-featured IDE and a step-by-step debugger. This will be discussed in another post.
Instructions:
The lines below with a “-” are actions and the lines with a “$” are commands:
- Download and install Virtualbox
- Download xubuntu iso
- Configure a new Virtual Machine with:
OS set to: Linux/Ubuntu 64
4 cores (assuming you have 8 cores)
2048 MB RAM (assuming you have at least 4096)
20 GB VDI dynamic disk
- Select the Xubuntu iso file in the first run wizard
- Install Xubuntu by following the steps
- Install additional drivers (guest additions) and reboot
- Open up a web browser
- Go to http://symfony.com/download and click download
- Save "Symfony_Standard_Vendors_2.x.xx.tgz" and unpack it
- Move the "Symfony" folder to your home directory and rename it to "public_html"
$ sudo apt-get install lamp-server^ php-apc apache2-mpm-itk php5-intl php5-sqlite phpmyadmin
choose a mysql root password
choose to configure phpmyadmin for apache2
$ sudo a2enmod rewrite
$ sudo nano /etc/php5/apache2/php.ini
NB: use Ctrl-W Ctrl-R to search and replace
search: ;date.timezone =
replace: date.timezone = Europe/Amsterdam
NB: enter your local timezone if you are not in Europe/Amsterdam
(see http://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
search: short_open_tag = On
replace: short_open_tag = Off
$ pwd
NB: note down the output, as this is the path of your home folder (in my case: /home/maurits)
$ id -un
NB: note down the output, as this is your user name (in my case: maurits)
$ id -gn
NB: note down the output, as this is your group name (in my case: maurits)
$ sudo nano /etc/apache2/sites-enabled/000-default
NB: use Ctrl-W Ctrl-R to search and replace
search: /var/www
replace: {YOUR_HOME_FOLDER}/public_html/web
NB: you have to enter the home folder path you found from the pwd command instead of {YOUR_HOME_FOLDER}
$ sudo nano /etc/apache2/sites-enabled/000-default
NB: add the following line under the DocumentRoot
AssignUserId {YOUR_USER_NAME} {YOUR_GROUP_NAME}
NB: you have to enter your user name and group name instead of {YOUR_USER_NAME} {YOUR_GROUP_NAME}
$ sudo service apache2 restart
- Open web browser and go to http://127.0.0.1/phpmyadmin
- Login with root user and chosen root password
- Click "Privileges"
- Click "Add a new User"
- Enter/choose:
username: symfony
host: localhost
password: symfony
retype: symfony
- Select "Create database with same name and grant all privileges"
- Click "Create User"
- Open a web browser and go to http://127.0.0.1/config.php
- verify that symfony does not complain about anything
- click "Configure your Symfony Application online"
- Enter/choose:
Driver: MySQL (PDO)
Host: localhost
Name: symfony
User: symfony
Password: symfony
Password again: symfony
- Let symfony generate a "Global Secret"
- Choose "Next Step"
- Symfony should say: Your distribution is configured!
- Click "Go to the Welcome page"
- Click "Run the Demo"
- Play around with the demo to see that everything works
Bonus instructions:
Some nice tips on how to customize your Xubuntu:
- You can make your Xubuntu panels look like Gnome2
http://namakutux.blogspot.com/2011/11/how-to-make-xfce-looks-like-gnome-2.html - You can replace abiword/gnumeric with the much better libre office:
sudo apt-get remove abiword gnumeric && sudo apt-get install libreoffice - You can replace leafpad with the full-featured gedit:
sudo apt-get remove leafpad && sudo apt-get install gedit
That is it for today, have fun!
