Archive
Get Linux distribution name
Why re-invent the wheel? This post gives ample details: http://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/
cat /etc/*-release
o
lsb_release -a
Installing BigBlueButton on CentOS5.5
The documentation to install BigBlueButton 0.64 on CentOS (and on most other distributions) is really excellent. However, I found that CentOS 5.5 had not been documented yet, so I tried it and run into a few problems. I explain below how to get it all sorted out. I installed CentOS5.5 from a DVD in “server” mode, so without graphical interface. Once installed, I proceeded with the following.
I followed the first directions from http://code.google.com/p/bigbluebutton/wiki/RPMPackaging#How_to_Install_BigBlueButton_on_CentOS_5.4
However, I ran into my first problem: the epel could not be found by the script, so I had to update the script to change epel-release-5-3.noarch.rpm for epel-release-5.4-noarch.rpm, then launch the script again.
Probably because the script had a problem, I had another problem later during the install: /etc/init.d/asterisk conflicted with asterisk14, so I had to remove Asterisk first: “yum remove asterisk14-core-1.4.36-1_centos5.x86-64″, then launch again “yum -y install bigbluebutton”
At this point, bigbluebutton should work fine from the local machine (if you are doing that on a CentOS5.5 server without graphical interface, try installing lynx and launching lynx localhost. If you see text saying BigBlueButton, you’re OK), but accessing this server from another machine might not work (could not connect, error 500, etc). This is (most probably) because your server has an iptables (default firewall) configuration preventing access on port 80 to your server from another computer. The quick solution to try it is to shut down iptables with “/etc/init.d/iptables stop” and try connecting again. If that works, then you’ll have to setup your firewall properly.
Finally, to install the desktop sharing utility, you will have to launch “yum install bbb-apps-deskshare”.
You might also be interested (as a backup- into a guide that explains how to install BigBlueButton on CentOS5.4 step by step: http://code.google.com/p/bigbluebutton/wiki/InstallingBigBlueButtonCentOS
BBB 0.70 seems to install fine on top of the 0.64, but the sound doesn’t work and the whiteboard features are not registering write operations (just showing on screen).
Como mostrar colores en edición de scripts en servidores con vim
- Editar (como admin) el fichero /etc/vim/vimrc y encontrar la línea que dice “syntax on” o “syntax off”
- Asegurarse que esta línea está a “syntax on” y que no esté comentada (una doble comilla al inicio la comentaría)
- Editar cualquier fichero de código usando vim… Ya está
- También se puede configurar por cuenta, usando el fichero .vimrc en la carpeta del usuario mismo y poniéndole un “syntax on”
Esta funcionalidad no usa muchos recursos (mientras no esté editando ficheros de más de medio MB) y es muy útil para ver el código de forma más clara/ordenada.
Mantis, genome comparison software
BeezNest is the proud provider of the hardware and systems architecture running the main server for Mantis, the missing link between multi-species full genome comparisons and functional analysis.
In February 2008, Raphaël Helaers, main developer of Mantis, working at the Université Libre de Bruxelles, and fellow student in my computer sciences studies, asked us if we were interested in providing an affordable, ultra-resistant, architecture for the server of their multi-species genome comparison tool. At the time, Jérôme configured the server, as it is his specialty, and we provided a few hours of support to get it launched and managed by the development team.
Two years, a full delocalization of the server from Belgium to Switzerland and one hardware cleaning later (pieces moved during the expatriation), the server is still in excellent shape and Mantis just released version 1.1!
We are very happy of the success of this project, which is one of the leading scientific projects in the genome study area.
Incidentally, and although unrelated, Mantis is now hosted in the Geneva University, for which we happen to be the proud publishers of the e-learning system in use there: Chamilo!
Reasons to (not) setup swap on GNU/Linux
Disclaimer: this article does not pretend to be a complete picture of using swap on UNIX.
Most of the time, recent GNU/Linux distributions insist on creating a swap area.
Swap is generally used to temporarily store memory used by running(/sleeping) applications, but might as well be used to store a copy of RAM to disk for hibernation. As disks are still many times slower than RAM, it always comes with huge performances impact.
Historically, RAM was so expensive that UNIX users bought only a fraction of actually used memory, and relied on swap for 2/3 of it (number still found in many advices today, while it is certainly outdated).
Today, you can buy quite a huge amount of RAM (even ECC) for almost nothing, it is not uncommon to be able to buy more than 4GB for less than 100€. So today, you buy RAM based on the total memory used by all the applications that might ever run at the same time. Of course, you probably don’t need then to allocate three times that amount to swap, especially when you know applications won’t use it.
The main danger of allocating much swap is that some application goes mad, eats up all memory, then swap and starts slowing down the whole machine (because it brings I/O in the dance), then (and only then) eventually get killed by the Linux OOM Killer, which is rather basic (just kills the running application taking currently the more memory, so might even miss the real guilty). Without swap (or reasonable amount), in contrast, the kill would happen far earlier, and not generate incredible I/O usage levels.
Of course, I/O impact is even worst in virtualized environments.
HOWTO Enable temporary swap file on GNU/Linux
GNU/Linux supports swapping to a file on any filesystem, with reasonable performance impact since kernel 2.4. This might be useful whenever needing a temporary increase in available memory, I’m writing this article with that goal in mind.
Create a zero-filled regular file (following example would create a 1024x1M=1G swap size):
dd if=/dev/zero of=/.swapfile bs=1024 count=1M
Setup a swap area in it:
mkswap /.swapfile
Activate swap to this file (would not survive a reboot):
swapon /.swapfile
To check it did it:
swapon -s
Disable swap to this file:
swapoff /.swapfile
Of course, the file is not deleted on reboot, and you might reuse it several times.
Howto reset network device after swapping disks from one PC to another
I had a problem with a very old Compaq PC not detecting the keyboard anymore. I used the PC as a local server, not a real problem, except that the BIOS didn’t allow the PC to boot when the keyboard was not plugged in. One solution there might have been to use some USB keyboard (I didn’t get a chance to try that – didn’t have any USB keyboard lying around).
Luckily enough, I happened to have a clone of this computer, so I just swapped the disks from one PC to the other, and booted. This one detected the keyboard without a problem and started booting Debian.
Now the problem was that Debian (which was on the disk which I swapped from one PC to another, thus changing all the devices IDs and stuff) wouldn’t find my network device (at least where I expected it to), so I was left with a working local server without network… pretty useless.
So I called my resourceful brother (Jérôme), and he quickly explained to me that Debian’s udev stored its NIC MAC address in /etc/udev/rules.d/*persistent-net*. Clearly, that was true. Then I didn’t know how to get the real MAC (I could probably have found it in /proc/ somewhere), but the thing is that, he said, you can just delete the file, reboot, and Debian will rebuild it.
So, one delete and reboot later, I had network on my local server! Thanks Jérôme!
Install Oracle Express and PHP OCI8 on Ubuntu 9.10
Copiado del post de Daniel escrito en el marco de sus proyectos aqui : http://danielphp.wordpress.com/install-oracle-express-and-php-oci8-on-ubuntu-9-10/
(Requirements: PHP 5 and Apache 2 already installed)
Go to Oracle website, and download the following files: (You are gonna need to register an account with Oracle to be able to download the files, just do it, its free)
- oracle-xe-universal_10.2.0.1-1.0_i386.deb
- Oracle instant client basic 11.2.0.1, zip package
- Oracle instant client sdk 11.2.0.1, zip package
Install the first file with just double click. then go to console and run this command to configure it:
/etc/init.d/oracle-xe configure
you will see something like this:
Specify the HTTP port that will be used for Oracle Application Express [8080]: Specify a port that will be used for the database listener [1521]: /* Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: */ Confirm the password: (* make sure you remember this password *) Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: y
At this point you can open Firefox,enter http://127.0.0.1:8080/apex, login as ’system’ with the ‘password’ you created during the install, and you should see the XE homepage.
Now put the other 2 files in /tmp. Then do the following:
cd /tmp/ unzip oracle-instantclient-basic-11.2.0.1.i386.zip mv instantclient_11_2 /opt/ unzip oracle-instantclient-devel-11.2.0.1.i386.zip mv instantclient_11_2/sdk /opt/instantclient_11_2/ export ORACLE_HOME=/opt/instantclient_11_2/ ln -s /opt/instantclient_11_2/libclntsh.so.11.1 /opt/instantclient_11_2//libclntsh.so ln -s /opt/instantclient_11_2/libocci.so.11.1 /opt/instantclient_11_2//libocci.so ln -s /opt/instantclient_11_2/ /opt/instantclient_11_2/lib
then install the packages php-dev and php-pear, and go to console and type the following:
pecl download OCI8 tar xzvf oci8-1.3.5.tgz cd ../oci8-1.3.5 phpize ./configure --with-oci8=instantclient,/opt/instantclient_11_2/ make sudo make install
At that point, the libraries have been built but are not used by PHP. In this extent, you must add it at the bottom of php.ini files “/etc/php5/apache2/php.ini” (and if you got CLI installed also add to this file “/etc/php5/cli/php.ini”):
extension = oci8.so
Edit your /etc/bash.bashrc file to include the lines:
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server PATH=$PATH:$ORACLE_HOME/bin export ORACLE_HOME export ORACLE_SID=XE export PATH
Now just do a logout and login (this will restart the env variables, if you are advanced user then just do it your way). restart apache.Finally try this php example:
$ora_conn = oci_connect('system',$your_password,'127.0.0.1/XE');
// error handling
if (!$ora_conn){
// do the following if it fails
$ora_conn_erno = oci_error();
echo ($ora_conn_erno['message']."\n");
oci_close($ora_conn);
} else {
// if it doesn't fail it will proceed with the rest of the script
echo "Connection Succesful\n";
oci_close($ora_conn);
}
If it shows “Connection Succesful” then you are done. Congratulations.
Additional Notes:
- this was tested with PHP 5.2.10 ,Apache/2.2.12 and Ubuntu 9.10 Karmic Koala
- check that the ORACLE_HOME path exist just in case you have problems.
- if the version of instantclient you download is different to 11.2, just change every reference to 11_2 for your new version.
Software installation on Linux is difficult
I can’t resist posting a link to this blog post :-) Takes around 1 minute to read it all… Great effort from the author. Comparative installation of simple cards game under Ubuntu and under Windows.
Easily avoid using your password in an SSH connexion: ssh-copy-id
On Linux systems, there used to be a mildly complicated but tedious way to allow you to SSH another computer using your public key, which involved finding and copying your public key on the other host, then connecting to the host and putting this key into ~/.ssh/authorized_keys.
Now there is a much simpler way to do that… Just launch the following command (with your own data), enter your password, and that’s it!
ssh-copy-id yourusername@remote.host.address
I love administrative simplification!
