Posts Tagged ‘Linux’

VirtualBox addons cannot be installed

Wednesday, April 22nd, 2009

Have you seen this error message:

root@ubuntu:/media/cdrom# ./VBoxLinuxAdditions-x86.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 2.1.4 Guest Additions for Linux installation...........................................................................................................................................................................................................
VirtualBox 2.1.4 Guest Additions installation
Please install the build and header files for your current Linux kernel.
The current kernel version is 2.6.27-11-server
Problems were found which would prevent the Guest Additions from installing.
Please correct these problems and try again.

Solution:

sudo aptitude install build-essential linux-headers-`uname -r`

or

sudo aptitude update && aptitude dist-upgrade && aptitude install linux-headers-`uname -r`

Related

How to export svn editor

Wednesday, April 22nd, 2009

Have you seen this message lately ?

csvn: Commit failed (details follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was found

Here is how to export SVN_EDITOR variable.

Feel free to change the editor to pico, nano etc.

echo export SVN_EDITOR=vi >> ~/.bash_profile

Logout and then Login again to *see* the change.
By *see* I mean that you have to do execute the following command and the editor of your choice should be run for you:

svn ci

Related:

How to get the total number of pages in a PDF file ?

Saturday, February 28th, 2009

These are at least 2 possible solutions how to get the total number of pages that are in a PDF file.
Requirements: ImageMagick

Option #1

convert Test.pdf - | grep -a Count

Output:

/Count 3

Option #2
identify Test.pdf
Output:

Test.pdf[0] PDF 612x792 612x792+0+0 PseudoClass 256c 16-bit 1.38694mb
Test.pdf[1] PDF 612x792 612x792+0+0 PseudoClass 256c 16-bit 1.38694mb
Test.pdf[2] PDF 612x792 612x792+0+0 PseudoClass 256c 16-bit 1.38694mb

The tests are performed on

uname -a
Linux server 2.6.25.6-27.fc8 #1 SMP Fri Jun 13 18:20:54 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

How to run a cron job every 6 hours ?

Tuesday, February 10th, 2009

It is very ofter for a every normal person to run scheduled jobs.

This could be backups, some processing that takes a lot of time etc.

Here is how to run a cron job every 6 hours

[code]
#min  hour day/month   month   day/week
0 */6 * * * /home/user/script.sh
[/code]

Have you tried to use "*" instead of 0 for the minutes ? ;) :D
I did and received a lot of emails ... it was working.

Related:

http://www.linuxforums.org/forum/redhat-fedora-linux-help/117506-running-crontab-every-7-hours.html

How to solve Error 403 / Forbidden on Fedora Core 10 at Slicehost

Sunday, February 8th, 2009

I played with lighttpd web server on my Fedora core 10 Slice and I was getting the annoying Error 403 error while accessing a simple phpinfo file.

Solution:
Login as root

[code]
vi /etc/lighttpd/lighttpd.conf
[/code]

Enable modules:

[code]
"mod_fastcgi"
"mod_simple_vhost"
[/code]

Setup a site and creates folders if they do not exist

[code]
simple-vhost.server-root   = "/var/www/vhosts/"
simple-vhost.default-host  = "domain.com"
simple-vhost.document-root = "/htdocs/"
[/code]

Enable fastcgi
[code]
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
[/code]

Also look for "url.access-deny" and make sure it does not contain a .php extension.

Restart the lighttpd server

[code]
/etc/init.d/lighttpd restart
[/code]

I assume that you've already executed

Disable apache and install

[code]
service httpd stop
chkconfig httpd off

yum install lighttpd
chkconfig lighttpd on
[/code]

Installing ffmpeg on Fedora Core 10

Saturday, February 7th, 2009

In a perfect world you'd execute "yum install ffmpeg" and yum will install the dependencies but sometimes it does not work without some extra effort.

Solution
Adding an additional yum repository.

Login as root

[code]
rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms
[/code]

[code]
# vi /etc/yum.repos.d/atrpms.repo
[/code]

Paste the contents

[code]
[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/f$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
[/code]

Execute the install command again

[code]
yum install ffmpeg
[/code]

Related:
http://atrpms.net/install.html

Voila.
Do let me know if that quick tip has saved you several hours

How to open port 80/http and 443/https on Fedora Core 10 at Slicehost

Friday, February 6th, 2009

Login as root

[code]
# vi /etc/sysconfig/iptables
[/code]
Add these lines
[code]
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
[/code]

Restart iptables

[code]
# /etc/init.d/iptables restart
[/code]
Related:
http://www.cyberciti.biz/faq/linux-iptables-firewall-open-port-80/

To become a Slicehost customer please go to: slicehost.com

How to disable “inactivity” screen lock on Fedora (KDE)

Monday, January 26th, 2009

On my development machine which runs Fedora code 8 used to prompt me every once in a while for password. This is very annoying but secure :)

Here are the steps how to disable that screen saver password prompt

Click "K" > Control Center > Appearance & Themes > Screen Saver

Under Settings uncheck "Require password to stop"

Related

  • http://www.databook.bz/?page_id=219
  • http://forum.soft32.com/linux/disable-inactivity-screen-lock-Fedora-Core-ftopict357046.html

How to mount a shared folder read/write permissions

Saturday, November 1st, 2008

Once I need to mount a Windows share on my Ubuntu Server.

By default the folder was mounted as readonly but I fixed that by supplying dmask=777,fmask

Here is the command I used.

[code]

mount -t smbfs -o username=guest,password=,dmask=777,fmask=777 //192.168.0.10/myshare /mnt/existing_folder/

[/code]

If you have any ideas or if I can add something and/or improve this article do leave a comment.

Thanks.

Slavi