Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts
Thursday, May 1, 2008
Encrypted filesystems for Linux
There are a few encrypted filesystems for Linux. Ones aimed at distributed filesystems (NFS replacements): - "CFS", which has been packaged and is available from non-us.debian.org. - "TCFS", http://tcfs.dia.unisa.it/ I used CFS several years ago and it seemed to work well. My only complaint was that triple DES was a bit slow on my 486/33. Another approach which I am currently using involves patching the kernel to provide kernel level encrypted filesystems. I have updated a patch for kernel 2.0.36 which was originally released in 1996 for kernel 2.0.11. I have gotten good results with this using IDEA encryption on systems ranging from a 486/33 to PII-350. There are now encryption patches available for the new 2.2.x kernels. ftp://ftp.kerneli.org/pub/linux/kerneli/v2.2/patch-int-2.2.1.1.gz will add encryption to linux 2.2.1. I have not used this patch yet, but I will give it a try as soon as I update to slink and have a 2.2.x compatible system. When unmounted, the ability to scan the raw partition will not give your cracker any useful information. If they are really determined, they could scan raw /tmp and swap partitions for traces of sensitive data. Whether this is an issue depends on your required security level. When mounted, a root cracker would be able to read the all files on the partition. Mounting the partition requires a passphrase. The kernel approach will require patching and building custom versions of the kernel and mount programs.
Wednesday, April 30, 2008
Protection Of SSH from Hackers
This Is used to add an additional layer to The System Security
# !/bin/sh
#
# swatch This shell script takes care of starting and stopping
# swatch.
#
# chkconfig: 2345 81 31
# description: Swatch is a System WATCHdog program that we are
# using here to block repeated failed ssh logins.
# processname: swatch
RETVAL=0
test -x /usr/bin/swatch || exit 0
start(){
echo "Starting swatch"
# Spawn a new swatch program
/usr/bin/swatch --config-file=/etc/swatchrc --tail-file=/var/log/secure --awk-field-syntax --tail-args "-F" &
echo $PID
return $RETVAL
}
stop () {
# stop daemon
echo "Stopping swatch:" $PROG
killall swatch
return $RETVAL
}
restart () {
stop
start
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
# !/bin/sh
#
# swatch This shell script takes care of starting and stopping
# swatch.
#
# chkconfig: 2345 81 31
# description: Swatch is a System WATCHdog program that we are
# using here to block repeated failed ssh logins.
# processname: swatch
RETVAL=0
test -x /usr/bin/swatch || exit 0
start(){
echo "Starting swatch"
# Spawn a new swatch program
/usr/bin/swatch --config-file=/etc/swatchrc --tail-file=/var/log/secure --awk-field-syntax --tail-args "-F" &
echo $PID
return $RETVAL
}
stop () {
# stop daemon
echo "Stopping swatch:" $PROG
killall swatch
return $RETVAL
}
restart () {
stop
start
RETVAL=$?
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
Sunday, April 27, 2008
ATI & Nvidia: Resume, Good News, Bad News
ATI & Nvidia: Resume, Good News, Bad News
If you're using ATI or Nvidia's binary drivers on a laptop, you've probably noticed that resuming from suspend & hibernate doesn't work so well. The fix is pretty simple, but definitely not intuitive.
Hit alt+f2 (or if you use KDE whatever their runbox thing is...or use a terminal)
Type in gksu gedit /etc/default/acpi-support (replace gksu gedit with kdesu kate if you use KDE)
Scroll to Line 17, which says MODULES="" and put fglrx (if you use ATI) or nvidia (if you use Nvidia) in the quotes
Save and exit
This will make the computer automatically unload your ATI or Nvidia drivers when you hibernate/suspend and reload them when you resume. If for some reason it still doesn't work perfectly (like the 3D is gone when you come back), try turning off Compiz before you suspend or hibernate. I've seen that mess with things too.
In the realm of good news, ATI has agreed to release open source drivers for Linux, just like Intel did years ago. Yay! In the realm of bad news, Nvidia still has not. We want to put pressure on Nvidia to rise to ATI's and Intel's challenge, do we not? Please take a moment to sign the Open Letter to Nvidia asking for fully free and open source 3D-accelerated Nvidia graphics drivers for Linux (8,264 signatures at time of posting) and Digg It. In case you aren't aware, there are 2D open source (barely...the code's fairly well obfuscated) Nvidia drivers on Linux, but that's not good enough for games or for Compiz. Nouveau has been working on creating these 3D open source Nvidia drivers for a while now by reverse engineering and doing lots of hardware probing. For now, they've got better 2D than Nvidia's own open source driver (haha) and some experimental 3D support on the cards the developers have in their own computer and therefore get to mess with the most.
If you're using ATI or Nvidia's binary drivers on a laptop, you've probably noticed that resuming from suspend & hibernate doesn't work so well. The fix is pretty simple, but definitely not intuitive.
Hit alt+f2 (or if you use KDE whatever their runbox thing is...or use a terminal)
Type in gksu gedit /etc/default/acpi-support (replace gksu gedit with kdesu kate if you use KDE)
Scroll to Line 17, which says MODULES="" and put fglrx (if you use ATI) or nvidia (if you use Nvidia) in the quotes
Save and exit
This will make the computer automatically unload your ATI or Nvidia drivers when you hibernate/suspend and reload them when you resume. If for some reason it still doesn't work perfectly (like the 3D is gone when you come back), try turning off Compiz before you suspend or hibernate. I've seen that mess with things too.
In the realm of good news, ATI has agreed to release open source drivers for Linux, just like Intel did years ago. Yay! In the realm of bad news, Nvidia still has not. We want to put pressure on Nvidia to rise to ATI's and Intel's challenge, do we not? Please take a moment to sign the Open Letter to Nvidia asking for fully free and open source 3D-accelerated Nvidia graphics drivers for Linux (8,264 signatures at time of posting) and Digg It. In case you aren't aware, there are 2D open source (barely...the code's fairly well obfuscated) Nvidia drivers on Linux, but that's not good enough for games or for Compiz. Nouveau has been working on creating these 3D open source Nvidia drivers for a while now by reverse engineering and doing lots of hardware probing. For now, they've got better 2D than Nvidia's own open source driver (haha) and some experimental 3D support on the cards the developers have in their own computer and therefore get to mess with the most.
Create/Find Hardware Reviews
Create/Find Hardware Reviews
Another release, another round of hardware that's never touched Linux having its virgin run. Also a lot of people going "but will my hardware work?" Please, please, take 15-30 minutes out of your day and review your hardware somewhere—or in more than one somewhere.Here are some suggestions:
Hardware Testing - At the very least do this one. It's built into Ubuntu. On Gutsy, it's in Applications -> System Tools. In Hardy, System -> Administration -> Hardware Testing. It'll run you through a few tests, asked if it worked, and ask for comments, then it submits the info to the Ubuntu devs using your Launchpad login. I don't think this is something that publicizes the results for easy shopping. The others all do.
Linux on Laptops - If you're a laptop user, take a look. Is your model listed? Is it up to date? If the answer to either question is "no," please submit the information. You can either make a webpage (they have a template) and send them a link or send the info as an attachment.
UbuntuHCL - Sign up and add your parts to their online database. It lets you filter the listing in lots of nice ways to look up info before making a purchase. One thing I like is that the results show a listing of parts with their average rating so you can take a nice list to the store.
Dohickey - Dohickey has a nice graphical client that asks you how well your hardware works, how hard it was to get working, etc. after auto-detecting what it all is. It then submits your results to its database which anyone can browse to find out what parts work well and easily, just like with UbuntuHCL.
Ubuntu Wiki - Lots of pages where you can add info, drilling down into the different categories of hardware. There are listings for prebuilt desktops, laptops, and individual parts.
Another release, another round of hardware that's never touched Linux having its virgin run. Also a lot of people going "but will my hardware work?" Please, please, take 15-30 minutes out of your day and review your hardware somewhere—or in more than one somewhere.Here are some suggestions:
Hardware Testing - At the very least do this one. It's built into Ubuntu. On Gutsy, it's in Applications -> System Tools. In Hardy, System -> Administration -> Hardware Testing. It'll run you through a few tests, asked if it worked, and ask for comments, then it submits the info to the Ubuntu devs using your Launchpad login. I don't think this is something that publicizes the results for easy shopping. The others all do.
Linux on Laptops - If you're a laptop user, take a look. Is your model listed? Is it up to date? If the answer to either question is "no," please submit the information. You can either make a webpage (they have a template) and send them a link or send the info as an attachment.
UbuntuHCL - Sign up and add your parts to their online database. It lets you filter the listing in lots of nice ways to look up info before making a purchase. One thing I like is that the results show a listing of parts with their average rating so you can take a nice list to the store.
Dohickey - Dohickey has a nice graphical client that asks you how well your hardware works, how hard it was to get working, etc. after auto-detecting what it all is. It then submits your results to its database which anyone can browse to find out what parts work well and easily, just like with UbuntuHCL.
Ubuntu Wiki - Lots of pages where you can add info, drilling down into the different categories of hardware. There are listings for prebuilt desktops, laptops, and individual parts.
Frozen Xwindow
Frozen Xwindow.
If your Xwindow freezes sometimes, here are two ways that you may try to kill your server. The first is the simple simple way of killing your X server the key combination: Ctrl+Alt+Backspace
The second way is a little more complicated, but it works most of the time. Hit Ctrl+Alt+F2 to startup a virtual console, then log in with your user name and password and run:
# ps -ax grep startx
This will give you the PID of your Xserver. Then just kill it with:
# kill -9 PID_Number
To go back to your first console, just hit Alt-F1
If your Xwindow freezes sometimes, here are two ways that you may try to kill your server. The first is the simple simple way of killing your X server the key combination: Ctrl+Alt+Backspace
The second way is a little more complicated, but it works most of the time. Hit Ctrl+Alt+F2 to startup a virtual console, then log in with your user name and password and run:
# ps -ax grep startx
This will give you the PID of your Xserver. Then just kill it with:
# kill -9 PID_Number
To go back to your first console, just hit Alt-F1
Customizing your directory colors
Customizing your directory colors.
I know a lot of you know the command ls --color. Which displays your directory with colors. But, a lot of people may not know that those colors are customizable. All you need to do is add the following line to your /etc/bashrc file.
eval `dircolors /etc/DIR_COLORS`
And then all of the color configuration can be found in the file /etc/DIR_COLORS
I know a lot of you know the command ls --color. Which displays your directory with colors. But, a lot of people may not know that those colors are customizable. All you need to do is add the following line to your /etc/bashrc file.
eval `dircolors /etc/DIR_COLORS`
And then all of the color configuration can be found in the file /etc/DIR_COLORS
Saturday, April 26, 2008
Dialup Using Red Hat netcfg
If you are using Redhat's netcfg utility to connect to the internet and you are sick of having to open up the GUI, and click on ACTIVATE to connect, and then have to click on DEACTIVATE to disconnect... here is one little thing that you can do to make life easier.
Let's say you have a ppp0 set up with netcfg. Just add this two lines to your /etc/bashrc
alias dial="/etc/sysconfig/network-scripts/ifup-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"
alias hangup="/etc/sysconfig/network-scripts/ifdown-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"
Now if you want to connect, all you need to do is to go to your terminal and type dial; if you would like to disconnect just
Let's say you have a ppp0 set up with netcfg. Just add this two lines to your /etc/bashrc
alias dial="/etc/sysconfig/network-scripts/ifup-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"
alias hangup="/etc/sysconfig/network-scripts/ifdown-ppp /etc/sysconfig/network-scripts/ifcfg-ppp0"
Now if you want to connect, all you need to do is to go to your terminal and type dial; if you would like to disconnect just
Friday, April 18, 2008
Fedora Core 7
Upgrading from previous Fedora
---------------------------------------------------
# rpm -Uhv http://rpm.livna.org/livna-release-7.rpm
Fedora 7 comes with a much improved font package which does NOT get installed when you upgrade for some reason. You'll first want to remove any of the Microsoft fonts first if you had installed them previously then install the new Red Hat provided fonts:
# rpm -ev msttcorefonts
# yum -y install liberation-fonts
# service xfs restart
And finally you're going to need to do an update of the whole system. This will most likely pick up official Fedora updates as well as updated packages from the Livna repository. This might take a while.
# yum -y update
Install MP3 Plug-in
-------------------------------
Since you've been following along this next step is about as easy as it gets. Just use yum to automatically install the MP3 plug-ins for xmms and Rhythmbox like this:
# yum -y install xmms xmms-mp3 xmms-faad2 gstreamer-plugins-ugly \
gstreamer-plugins-bad libmad libid3tag
While you're here you might as well install music player
Banshee:
# yum -y install banshee
The -y flag is to automatically answer yes to any question. If you want to be able to say no you can ignore that flag.
While you're there I highly recommend the grip CD ripper which supports both MP3 and Ogg formats. Once again installation is quite simple:
# yum -y install grip
Other Handy Utilities
----------------------------------
Here are a few other tools that aren't installed by default but a lot of people find handy:
# yum -y install gnomebaker testdisk thunderbird \
screen cups-pdf filelight unrar boost
boost - Advanced graphical Bittorrent
clientcups-pdf - Add-on to CUPS which creates a PDF Printer which you can use to print any document in PDF format. The file is written to your Desktop.
filelight - A wonderful graphical viewer of where your disk space usage is. Very handy for cleaning up your home directory.
gnomebaker - GTK based CD/DVD burning utilityscreen - If you do a lot with the command line you'll find screen
invaluabletestdisk - Two command line utilities to recover lost partitions and undelete files on FAT filesystems. VERY handy for undeleting files on flash memory cards.
thunderbird - Excellent E-mail client that complements Firefox
unrar - Useful utility to extract RAR archives
Install Java J2RE and Mozilla Plug-in
----------------------------------------------------------
It's also very handy to have the Java run-time environment available and most importantly a Mozilla plug-in so you can view dynamic content. It's unfortunate that Mozilla will actually crash if you go to a site containing Java and you don't have the plug-in installed. The libraries in Fedora 7 are newer than the ones used by Sun's build so you'll also need to install a compatability library.
Java Runtime Environment (JRE) 6 Update 2 from Java.com. You'll want to grab the Linux RPM in self-extracting file. Then you want to install it with:
# yum -y install compat-libstdc++-33
# sh ./jre-6u2-linux-i586-rpm.bin
Then you'll probably want to enable Java Plug-ins and here once again there is no easy way:
# ln -s /usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
And finally you'll need to tell Fedora that you wish to use this version of Java as the preferred interpreter rather than the Open Source version that's installed by default. You'll of course need to adjust the full pathname if you install a newer version of the jre than the one in this example: # /usr/sbin/alternatives --install /usr/bin/java java \
/usr/java/jre1.6.0_02/bin/java 1602
# /usr/sbin/alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
* 2 /usr/java/jre1.6.0_02/bin/java
Enter to keep the current selection[+], or type selection number: 2
# java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
If you know of an easier way please post it to the Comments section below.
After you re-start your browser you can test the Java plug-in installation at http://java.com/en/download/installed.jsp
---------------------------------------------------
# rpm -Uhv http://rpm.livna.org/livna-release-7.rpm
Fedora 7 comes with a much improved font package which does NOT get installed when you upgrade for some reason. You'll first want to remove any of the Microsoft fonts first if you had installed them previously then install the new Red Hat provided fonts:
# rpm -ev msttcorefonts
# yum -y install liberation-fonts
# service xfs restart
And finally you're going to need to do an update of the whole system. This will most likely pick up official Fedora updates as well as updated packages from the Livna repository. This might take a while.
# yum -y update
Install MP3 Plug-in
-------------------------------
Since you've been following along this next step is about as easy as it gets. Just use yum to automatically install the MP3 plug-ins for xmms and Rhythmbox like this:
# yum -y install xmms xmms-mp3 xmms-faad2 gstreamer-plugins-ugly \
gstreamer-plugins-bad libmad libid3tag
While you're here you might as well install music player
Banshee:
# yum -y install banshee
The -y flag is to automatically answer yes to any question. If you want to be able to say no you can ignore that flag.
While you're there I highly recommend the grip CD ripper which supports both MP3 and Ogg formats. Once again installation is quite simple:
# yum -y install grip
Other Handy Utilities
----------------------------------
Here are a few other tools that aren't installed by default but a lot of people find handy:
# yum -y install gnomebaker testdisk thunderbird \
screen cups-pdf filelight unrar boost
boost - Advanced graphical Bittorrent
clientcups-pdf - Add-on to CUPS which creates a PDF Printer which you can use to print any document in PDF format. The file is written to your Desktop.
filelight - A wonderful graphical viewer of where your disk space usage is. Very handy for cleaning up your home directory.
gnomebaker - GTK based CD/DVD burning utilityscreen - If you do a lot with the command line you'll find screen
invaluabletestdisk - Two command line utilities to recover lost partitions and undelete files on FAT filesystems. VERY handy for undeleting files on flash memory cards.
thunderbird - Excellent E-mail client that complements Firefox
unrar - Useful utility to extract RAR archives
Install Java J2RE and Mozilla Plug-in
----------------------------------------------------------
It's also very handy to have the Java run-time environment available and most importantly a Mozilla plug-in so you can view dynamic content. It's unfortunate that Mozilla will actually crash if you go to a site containing Java and you don't have the plug-in installed. The libraries in Fedora 7 are newer than the ones used by Sun's build so you'll also need to install a compatability library.
Java Runtime Environment (JRE) 6 Update 2 from Java.com. You'll want to grab the Linux RPM in self-extracting file. Then you want to install it with:
# yum -y install compat-libstdc++-33
# sh ./jre-6u2-linux-i586-rpm.bin
Then you'll probably want to enable Java Plug-ins and here once again there is no easy way:
# ln -s /usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
And finally you'll need to tell Fedora that you wish to use this version of Java as the preferred interpreter rather than the Open Source version that's installed by default. You'll of course need to adjust the full pathname if you install a newer version of the jre than the one in this example: # /usr/sbin/alternatives --install /usr/bin/java java \
/usr/java/jre1.6.0_02/bin/java 1602
# /usr/sbin/alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
+ 1 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
* 2 /usr/java/jre1.6.0_02/bin/java
Enter to keep the current selection[+], or type selection number: 2
# java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
If you know of an easier way please post it to the Comments section below.
After you re-start your browser you can test the Java plug-in installation at http://java.com/en/download/installed.jsp
Linux Tips & Tricks (Sound)
I use mpg123 (there's a debianized package) with sox. The command line is the following: #!/bin/bash# mp32wav mpg123 -b 10000 -s "$1" sox -t raw -r 44100 -s -w -c2 - "$2" And the use is: mp32wav
file.mp3=> file.wav
MP32Wav: http://www.chip.co.id/freeware/mpw00.html
8hz-mp3, http://www.8hz.com
bladeenc, http://home8.swipnet.se/~w-82625
Bladeenc is supposedly faster.
file.mp3=> file.wav
MP32Wav: http://www.chip.co.id/freeware/mpw00.html
8hz-mp3, http://www.8hz.com
bladeenc, http://home8.swipnet.se/~w-82625
Bladeenc is supposedly faster.
Subscribe to:
Posts (Atom)
IMPORTANT
All things mentioned here are solely related to Linux and its related things.The author has taken it from various thirdparty sites and creadit should be given accordingly.This has been done in order to simplify your searching task.The tips and tricks section hav various tricks mentioned.Please DO IT ON YOUR OWN RISK.THE AUTHOR DOESNOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE TO YOUR PROPERTY.