Thursday, December 10, 2009

FreeBSD - enable su for users.

While tinkering with freeBSD it convinced of its abilities qualifing as development box. Well at home FreeBSD runs over Fedora (in VirtualBox - Bridged Networking mode) and i can ssh to it both from desktop and laptop. But its really a wonder that FreeBSD denies root access remotely (aka. ssh). One easy and rather non-acceptable way is to allow root to login ( enter PermitRootLogin in /etc/ssh/sshd_config ), but it breaks the whole secure feature of FreeBSD.
The optimim way is to add a user to do 'su' which later can be used to remote login.

Steps to add user to root group (wheel).
# pw user mod -G wheel
# groups

For new users just add it to wheel along with default group while doing adduser.


Next you can allow su for all users.
Follow these steps.
# vi /etc/pam.d/su

and look for
'auth requisite pam_wheel.so no_warn auth_as_self noroot_ok exempt_if_empty' and comment it.

Happy sshing. "_"

Friday, March 6, 2009

TCP Header.

Learn this for if you are into networking.


0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

TCP Header Format

Note that one tick mark represents one bit position.

Details http://tools.ietf.org/html/rfc793#section-3.1

Monday, December 29, 2008

Mood Swing

Monday
Monday monster is here, it will hunt you down, drag u by your feet, slap an early morning bath, throw u inside the cubical cell and strap u the electric chair. u can prey forgiveness but it wont listen. suffer my baby all week long. ;(

Tuesday
I was dragged, pushed, eaten and labored by Monday monster. Tuesday daemon is pinging me back.

Friday, October 17, 2008

Ubuntu - Auto mounting HDD at boot

After fidlling lot with Ubuntu finally here the sequence to auto mount HDD partitions and make them behave properly.

1. Open /etc/fstab. Add these lines.
 
/dev/sda2 /media/Vista ntfs-3g defaults,user,exec,uid=1000,gid=100,umask=000 0 0
 /dev/sda3 /media/SOFTWARE vfat defaults,user,exec,uid=1000,gid=100,umask=000 0 0


2. Make the corresponding directories in /media ( remember to mount the HDD partitions in the /media not the traditional /mnt else Ubuntu wont show it as HDD ).

3. Test the fstab success
 sudo mount -a


4. To find all the drives entries use fdisk or blkid
 sudo blkid


That's it, next reboot all partitions will be auto mounted.

Saturday, October 11, 2008

iMac defeated

Finally tweaked ubuntu to defeat the display superiority of Mac. It aint so easy since Ubuntu is as ugly as anything can be. Unfortunately connonical didnt realize that users "look" at the monitor, so looks should be pleasant. But no big deal, not everything should be done by them lets fix it.

Simply install avant-window-manager and conky to get the look.

Installation guides.
http://www.quicktweaks.com/2008/04/11/three-little-things-to-make-your-ubuntu-desktop-beautiful-and-productive/
http://www.quicktweaks.com/2008/09/27/gmail-weather-beauty-right-on-your-ubuntu-desktop/

For Mac-user's envy here's the screenshot.

Mplayer

Well sometime linux can be frustrating and when it comes to mplayer nothing can me more worse. After lots of head banging i found a simple and elegant way to do it. Simply type in the following commands and mplayer will be up n running.

1. Add mplayer repositories. For that open /etc/apt/sources.list and augment these two line.
 deb http://archive.ubuntu.com/ubuntu dapper multiverse
 deb-src http://archive.ubuntu.com/ubuntu dapper multiverse


2. Run these two commands.
 sudo apt-get update
 sudo apt-get install mplayer


3. Run Mplayer, If all goes fine you can have a gala time. But for it was not so. Mplayer took lots of loading time while disabling screensaver. I read that a conflict b/w comfiz and mplayer. So simply goto mplayer>right click>preference>misc and uncheck "Disable screensaver" stuff.

4. In case mplayer not finding video out device. open ~/.mplayer/config and search for line "vo".
Simply add the output device name like xv. Finally your mplayer conf should have something like "vo=xv". To list all supported device type `mplayer -vo help` that will list you out all the option..
 mplayer -vo help


5. Worst, mplayer's got dumb. Simply mplayer>Right click>preference>Audio Tab select "pulseAudio".

Hope this helps