
Friday, May 15, 2009
Dreambox HD

Every once in a while something comes along that really impresses me, my Blackberry was one of them, Virtual Machines another, my WD 1 Terabyte Mybook and now dream box HD has just been added to that list.
The dream box is a Linux based set-top box with a MIPS processor, a Satellite card , gigabit Ethernet card, USB slot digital audio out and DVI / HDMI out .(dependiing on the model you buy)
connected to a motorized satellite dish, you can receive thousands of Satellite channels available under the Sky, as you can imagine , there is no shortage of choice of channels,
The HD channels I must say are awesome to watch, and by installing an internal 500GB Sata drive, you can pause live television, and record 77 hours of HD television in HD.
Were the Dream box comes into its own, is the pluggins that are available for it, and the fact that it is a Linux O.S connected to your home network and the Internet, means that it easily serves as a HD media center for all of your Multimedia content. and the possibilities are endless. My current setup allows me to stream television to every PC or Laptop in my house, I can change channels from the web interface available to every PC laptop in my house, my dream box also accesses my WD 1 terabyte Mybook drive were all my HD home video is stored, as well as all my digital pictures, which I can now enjoy in the comfort of my lounge in full HD and in 5.1 surround sound. My MP3 collection is now served up to my HiFi set and my Media tomb UPnP stream is also accessible via the Dreambox. I can access my dreambox from a blackberry, veiw the program guide and setup a recording from a Blackberry or any 3G phone.
the dream box has been the missing link that I've been waiting for that has made complete media convergence for the home in HD now easy to achieve.
the dreambox 8000 HD can take up to 4 tuners , which means you can record 3 different channels at the same time whilst watching a 4th, provided they are all on the same Satellite.
Now to find the time to do anything Else.
Wednesday, April 1, 2009
using NMAP to Scan your entire network for Conficker

Since a signature has been discovered that conficker worm leaves
on infected machines, you can now scan a machine and ask it ,if it is infected with the conficker worm,
beta5 version of NMAP provides this ability.
follow these quick steps to scan entire networks and give them a clean
bill of health from the conficker worm.
to download and install Nmap beta 5 do the following:
on infected machines, you can now scan a machine and ask it ,if it is infected with the conficker worm,
beta5 version of NMAP provides this ability.
follow these quick steps to scan entire networks and give them a clean
bill of health from the conficker worm.
to download and install Nmap beta 5 do the following:
wget http://download.insecure.org/nmap-dist/nmap-4.85BETA5.tar.bz2
bzip2 -cd nmap-4.85BETA5.tar.bz2 | tar xvf -
cd nmap-4.85BETA5
./configure
make
su root
make install
to Scan for conficker type the following
nmap -PN T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 [target network]
eg:
nmap -PN T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.1.0/24
bzip2 -cd nmap-4.85BETA5.tar.bz2 | tar xvf -
cd nmap-4.85BETA5
./configure
make
su root
make install
to Scan for conficker type the following
nmap -PN T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 [target network]
eg:
nmap -PN T4 -p139,445 -n -v --script=smb-check-vulns --script-args safe=1 192.168.1.0/24
the scan will take a while depending on the size of your network.
Tuesday, March 31, 2009
saving a file in VI as root
It often happens that you open up a file for editing using vi or vim and only when you come to save the file, you realise you did not open the file with root privileges and are unable to save the file.
when you type :wq!
you get E212: Can't open file for writing.
If that happens to you , simply type
:w !sudo tee %
you will be asked for your sudo password
enter your password and
press enter when asked
(
it to be reloaded.)
when you type :wq!
you get E212: Can't open file for writing.
If that happens to you , simply type
:w !sudo tee %
you will be asked for your sudo password
enter your password and
press enter when asked
(
vi/vim will detect that the file has been changed and ask whether you wantit to be reloaded.)
As a shortcut, you can define your own command.
Put the following in your /etc/vimrc
command W w !sudo tee % > /dev/null
and then in future simply type
:W
Friday, March 27, 2009
How to Stop yum from updating your Kernel
On a Server and also on your own machine, kernel Upgrades can break already installed 3rd party Applications, since the application would have been compiled for use on a specific kernel, I find this to be particularly a problem with vmware and Virtual box, every time my system upgrades its kernel there are a few packages that i need to recompile to get to work, this is a real pain, and on your server can lead to serious problems. To stop yum from updating your Kernel
You can tell yum to skip kernel updates by adding kernel-* to the 'exclude=' option in /etc/yum.conf. if the exclude option does not exist simply add it, add in a line that says exclude=kernel-*
you can do the same for any package that you do not want to update, for example, I run a patched version of postfix on one of my servers, since ive included a quota patch when I compiled it , I do not want postfix to upgrade to an unpatched version. So to stop that particular server from upgrading postfix I simply added postfix to the 'exclude=' option in /etc/yum.conf
you can add multiple exclude options by simply adding exclude=app_name_to_exclude under one another.
You can tell yum to skip kernel updates by adding kernel-* to the 'exclude=' option in /etc/yum.conf. if the exclude option does not exist simply add it, add in a line that says exclude=kernel-*
you can do the same for any package that you do not want to update, for example, I run a patched version of postfix on one of my servers, since ive included a quota patch when I compiled it , I do not want postfix to upgrade to an unpatched version. So to stop that particular server from upgrading postfix I simply added postfix to the 'exclude=' option in /etc/yum.conf
you can add multiple exclude options by simply adding exclude=app_name_to_exclude under one another.
Tuesday, March 24, 2009
Test smtp server with required authentication
To test your smtp server, to see if it is an open relay or to
test if your authentication works on it. Use telnet to connect
to the server, this allows you to very quickly test different connection
scenarios to the server. this method is very useful if you
want to test how your smtp server behaves from different remote locations,
and all you have is an ssh account into the locations you want to test from.
You can simply ssh into the remote location you want to test from and then
follow these steps
In this example I wanted to test if basic outgoing smtp authentication was working on my server (everything in Bold is what you type everything not in bold is the servers response)
telnet smtp.mailserver.com 25
Trying 195.158.102.65...
Connected to mail.clivesblog.com.
Escape character is '^]'.
220 smtp.mailserver.com.com ESMTP ready
ehlo
250-smtp.mailserver.com ESMTP hello
250-PIPELINING
250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 GSSAPI
250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 GSSAPI
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-SIZE 10485760
250-STARTTLS
250-HELP
250 OK
auth login
334 VXNlcm5hbWU6
Y2xpdmUuZ2VyYWRhQHJzMi5jb20=
334 UGFzc3dvcmQ6
cnMy
235 Authentication successful
mail from:clive.gerada@clivesblog.com
250 Sender accepted
rcpt to:anybody@anyaddress.com
250 Recipient accepted
data
354 Ready to receive data; remember.
subject: any subject
double space (ie hit the space bar twice)
then enter any text for the body of the email
.
250 Mail queued for delivery
quit
221-smtp.mailserver.com ESMTP is closing connection
221 Good bye
the Y2xpdmUuZ2VyYWRhQHJzMi5jb20=
and cnMy
is my username and password encoded in Basd64 cypher
you have to encode it in base64 for the server to understand it.
you can use the following online tool to encode and decode to and from base64
perl -MMIME::Base64 -e 'print encode_base64("username");'
perl -MMIME::Base64 -e 'print encode_base64("password");'
http://ostermiller.org/calc/encode.html
test if your authentication works on it. Use telnet to connect
to the server, this allows you to very quickly test different connection
scenarios to the server. this method is very useful if you
want to test how your smtp server behaves from different remote locations,
and all you have is an ssh account into the locations you want to test from.
You can simply ssh into the remote location you want to test from and then
follow these steps
In this example I wanted to test if basic outgoing smtp authentication was working on my server (everything in Bold is what you type everything not in bold is the servers response)
telnet smtp.mailserver.com 25
Trying 195.158.102.65...
Connected to mail.clivesblog.com.
Escape character is '^]'.
220 smtp.mailserver.com.com ESMTP ready
ehlo
250-smtp.mailserver.com ESMTP hello
250-PIPELINING
250-AUTH PLAIN LOGIN CRAM-MD5 DIGEST-MD5 GSSAPI
250-AUTH=PLAIN LOGIN CRAM-MD5 DIGEST-MD5 GSSAPI
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250-SIZE 10485760
250-STARTTLS
250-HELP
250 OK
auth login
334 VXNlcm5hbWU6
Y2xpdmUuZ2VyYWRhQHJzMi5jb20=
334 UGFzc3dvcmQ6
cnMy
235 Authentication successful
mail from:clive.gerada@clivesblog.com
250 Sender accepted
rcpt to:anybody@anyaddress.com
250 Recipient accepted
data
354 Ready to receive data; remember
subject: any subject
double space (ie hit the space bar twice)
then enter any text for the body of the email
.
250 Mail queued for delivery
quit
221-smtp.mailserver.com ESMTP is closing connection
221 Good bye
the Y2xpdmUuZ2VyYWRhQHJzMi5jb20=
and cnMy
is my username and password encoded in Basd64 cypher
you have to encode it in base64 for the server to understand it.
you can use the following online tool to encode and decode to and from base64
perl -MMIME::Base64 -e 'print encode_base64("password");'
will encode base64 for you or alternatively you can use an online encoder like
http://ostermiller.org/calc/encode.html
How to Encrypt/decrypt files

If you want to protect files so that they can transverse across cyberspace safely, or you just want to protect them from
prying eyes with a password.
use the gpg command.
gpg -c filename
You will be asked for a pass phrase.
enter your pass phrase.
You will be asked to repeat your pass phrase
a file will be created with the .gpg extention
Caution: if you forget your pass phrase you will not be able to recover your file. the encryption used is that good.
to decrypt the file simply type
gpg filename.gpg
enter your pass phrase when asked.
To do multiple files I usually zip them into one zip file and then encrypt the zip file.
you can do this in one shot by typing the following
zip - file1 file2 file3 file4 file5 | gpg -eat > outfile.zip.asc
Saturday, March 21, 2009
Friday, March 20, 2009
Alternating between directories in your Terminal
often, I am working in a directory which has a long path eg /home/cgerada/long/complicated/directory/structure/folder/
and then want to temporally change to another directory to do something and change back to the directory I was in
instead of using cd to change to the other directory rather use
pushd eg pushd /directory
that way when you are done in /directory and you want to return to /home/cgerada/long/complicated/directory/structure/folder/
simply type popd
and you will be returned to /home/cgerada/long/complicated/directory/structure/folder/
cd - is also very useful and will take you to your last working directory
and is great for switching between 2 directories .. just type cd - and then cd- again to alternate between 2 working directories
and then want to temporally change to another directory to do something and change back to the directory I was in
instead of using cd to change to the other directory rather use
pushd eg pushd /directory
that way when you are done in /directory and you want to return to /home/cgerada/long/complicated/directory/structure/folder/
simply type popd
and you will be returned to /home/cgerada/long/complicated/directory/structure/folder/
cd - is also very useful and will take you to your last working directory
and is great for switching between 2 directories .. just type cd - and then cd- again to alternate between 2 working directories
Thursday, March 19, 2009
Quick way to Rip a DVD
Insert your DVD into your DVD Drive of your PC/Laptop
and type the following in your terminal
It doesn't even need to be that complicated.
These commands will work too (isn't Linux wonderful?)
cp /dev/cdrom cd.iso
cat /dev/cdrom > cd.iso
and type the following in your terminal
dd if=/dev/cdrom of=/cdrom_image.iso
your DVD will be saved as an iso image in your current directory.It doesn't even need to be that complicated.
These commands will work too (isn't Linux wonderful?)
cp /dev/cdrom cd.iso
cat /dev/cdrom > cd.iso
Saturday, March 14, 2009
.ssh/config
ssh reads configuration information from a config file (if you have one) before connecting to a machine. This way you can tell ssh how you want to connect toparticular machines. If you have a lot of different machines that you connect to, especially if youconnect to them on different ports and with different user names then it is a great idea to create the following file .ssh/config type vi .ssh/config and popultate the config file with the information of the machines that you connect to. eg Host *netaxiz.com Port 2222 User clive Host ipcop1 Port 222 User root Host home Hostname 192.168.0.10 User clive Port 768 with the above information in the config file if you typessh machine.netaxiz.com will be the equivalent of typing ssh -p 2222 clive@machine.netaxiz.com and typing scp file1 ipcop1:file1 will be the equavelent of typing scp -P222 file1 root@ipcop1 as you can see the config file can save you a lot of time. The port and the username from the config file will automatically be used every time you connect to the machines listed in the config file. Were this is especially usefull is when you want to copy ssh keys to a remote machine using the ssh-copy id command when the remote machine uses a different port to 22. Lets say you want to copy your public keys to your machine called home but machine home only allows ssh connection on port 768. By adding in the information above for machine home. I can now simply type ssh-copy-id -i ~/.ssh/id_rsa.pub home to transfer the keys.
if you get the following error when using ssh
Bad owner or permissions on .ssh/config
then you must change the permissions of the config file.
cd .ssh
chmod 600 config
Sunday, March 8, 2009
libdvdcss
To Play a commercial DVD in your media player
you need to install libdvdcss
you will also need libdvdcss to be able to backup your commercial DVD's ;)
yum install libdvdcss
or apt-get install libdvdcss depending on your distro
you need to install libdvdcss
you will also need libdvdcss to be able to backup your commercial DVD's ;)
yum install libdvdcss
or apt-get install libdvdcss depending on your distro
Monday, February 23, 2009
RPM Fusion Repository
RPM Fusion Repository provides software that the Fedora Project
or Red Hat doesn't want to ship.
You will find software like VLC media player, Mencoder FFmpeg
and other software that is not available in the stock Fedora or
Red hat repositories.
to install the RPM Fusion repository on your system simply type
the following.
rpm -ivh http://download1.rpmfusion.org/free/fedora/
rpmfusion-free-release-stable.noarch.rpm
then you can install software directly ie
yum install vlc
How to find out what Distro you are running
uname -a will give you information about your running Kernel. To find out what Distribution is installed on a Particular system try one the following:
cat /etc/issue
or
cat /proc/version
or
cat /etc/*release
cat /etc/issue
or
cat /proc/version
or
cat /etc/*release
Thursday, October 30, 2008
How to change the Time Zone on your Redhat / Centos system
cp /usr/share/zoneinfo/Africa/Johannesburg /etc/localtime
will set your time zone to SAST
you can simply use Tab auto completion to find the exact time zone you want by choosing the continent and city of your choice for example to change your timezone to London's time
cp /usr/share/zoneinfo/Europe/London /etc/localtime
to change to universal time type
cp /usr/share/zoneinfo/Universal /etc/localtime
to change to GMT time type
cp /usr/share/zoneinfo/GMT /etc/localtime
if asked if you want to overwrite the localtime file answer yes.
Tab auto completion is very useful in finding the exact time zone you want.
will set your time zone to SAST
you can simply use Tab auto completion to find the exact time zone you want by choosing the continent and city of your choice for example to change your timezone to London's time
cp /usr/share/zoneinfo/Europe/London /etc/localtime
to change to universal time type
cp /usr/share/zoneinfo/Universal /etc/localtime
to change to GMT time type
cp /usr/share/zoneinfo/GMT /etc/localtime
if asked if you want to overwrite the localtime file answer yes.
Tab auto completion is very useful in finding the exact time zone you want.
Tuesday, October 14, 2008
How to backup and restore a Mysql database
To backup your mysql database type the following.
mysqldump -u username -ppassword database_name > dump.sql
make sure not to leave a space between the -p and the password, otherwise mysql will prompt you for a password and will assume that your password is the database name.
the entire database will be backed up into the dump.sql file
then to restore the database type the following
'mysql -u username -ppassword database_name < dump.sql'
mysqldump -u username -ppassword database_name > dump.sql
make sure not to leave a space between the -p and the password, otherwise mysql will prompt you for a password and will assume that your password is the database name.
the entire database will be backed up into the dump.sql file
then to restore the database type the following
'mysql -u username -ppassword database_name < dump.sql'
Thursday, September 25, 2008
How to reset a Forgotton Password in MYSQL
ever forgotton your root password for your mysql database, or any other users password for that matter, no problem here
simply stop mysql by typing
/etc/init.d/mysqld stop
then restart Mysql with the following command
simply stop mysql by typing
/etc/init.d/mysqld stop
then restart Mysql with the following command
mysqld_safe --skip-grant-tables
You should see mysqld start up successfully. Now you should be able to connect to mysql without a password.
mysql --user=root mysql
update user set Password=PASSWORD('new-password');
flush privileges;
exit;
once done restart mysql normally
/etc/init.d/mysqld restart
Shaaawiiing
Wednesday, September 17, 2008
How to add multiple users and passwords to your system
for names in user1 user2 user3 user4 user5
do
useradd $names
echo "anypassword" | passwd --stdin $names
done
or you can type it all in one line and hit enter like so
for names in user1 user2 user3 user4 user5;do useradd $names;echo "anypassword" |passwd --stdin $names;done
the above will add user1 , user2 ,user3, user4 and user5 to your system.
All users will have the password "their user name followed by anypassword"
You could have your list of users in a text file and enter the commands like so, presuming your text file is called users.txt and in your text file you just insert the user names underneath one another eg
user1
user2
user3
etc
for names in `cat users.txt`
do
echo $names
useradd $names
done
If you want to add usernames and passwords from a list, then make a text file like so
user1:password1
user2:password2
user3:password3
etc
save the file , in this example we'll save it as userlist.txt
then
for names in `cat userlist.txt`
do
user=`echo $names | cut -f1 -d:`
pwd=`echo $names | cut -f2 -d:`
useradd $user
echo $pwd | passwd --stdin $user
done
do
useradd $names
echo "anypassword" | passwd --stdin $names
done
or you can type it all in one line and hit enter like so
for names in user1 user2 user3 user4 user5;do useradd $names;echo "anypassword" |passwd --stdin $names;done
the above will add user1 , user2 ,user3, user4 and user5 to your system.
All users will have the password "their user name followed by anypassword"
You could have your list of users in a text file and enter the commands like so, presuming your text file is called users.txt and in your text file you just insert the user names underneath one another eg
user1
user2
user3
etc
for names in `cat users.txt`
do
echo $names
useradd $names
done
If you want to add usernames and passwords from a list, then make a text file like so
user1:password1
user2:password2
user3:password3
etc
save the file , in this example we'll save it as userlist.txt
then
for names in `cat userlist.txt`
do
user=`echo $names | cut -f1 -d:`
pwd=`echo $names | cut -f2 -d:`
useradd $user
echo $pwd | passwd --stdin $user
done
Monday, September 1, 2008
How to remove @#$ Annoying Console beeps
To Remove all console beeps whilst running X type
xset b offthis will disable the annoying console beeps for all programs.
To remove the console beep when running in run level 1 2 or 3 without X, or on one of the virtual consoles ( cntrl-Alt 1 to 6) type
setterm -blength 0
Thursday, August 28, 2008
Nog a sweet IP Tables rule
This one will force your users through your Squid proxy server, even if your users are configured to access the net directly
iptables -t nat - A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
assuming that your squid proxy is configured to use port 3128 the above rule on your iptables firewall.
or if your squid proxy server is on a different server say 192.168.1.10 then
iptables -t nat - A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT -d 192.168.1.10 --to-ports 3128
if you need to insert the rule at line number 5 of an existing chain then
iptables -t nat - I PREROUTING 5 -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
will forward all standard port 80 http traffic to your Squid Proxy server on port 3128 .......sweet
iptables -t nat - A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
assuming that your squid proxy is configured to use port 3128 the above rule on your iptables firewall.
or if your squid proxy server is on a different server say 192.168.1.10 then
iptables -t nat - A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT -d 192.168.1.10 --to-ports 3128
if you need to insert the rule at line number 5 of an existing chain then
iptables -t nat - I PREROUTING 5 -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 3128
will forward all standard port 80 http traffic to your Squid Proxy server on port 3128 .......sweet
Subscribe to:
Posts (Atom)

