Monday, January 19, 2009
Setting up s/w raid on gnu/linux
note to self
mdadm can be used to create raid volumes easily in the below way.
mknod -m 0640 /dev/mdX TYPE MAJOR MINOR
chgrp disk /dev/mdX
mdadm --create=/dev/mdX --level='RAID LEVEL' --raid-devices=n /dev/sdXX /dev/sdYY
RAID LEVEL can be any value from linear, raid0, 0, stripe, raid1, 1, mirror, raid4, 4, raid5, 5, raid6, 6, raid10, 10, multipath, mp, faulty.
Eg: Creating a RAID 0 with 2 physical devices /dev/sda1 and /dev/sdb1.
mknod -m 0640 /dev/md0 b 9 0
chgrp disk /dev/md0
mdadm --create='/dev/md0' --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1
mknod is quite important, as otherwise mdadm will complain about non-existent device. Make sure to specify unused MAJOR and MINOR numbers when creating the (block)device. Refer to mknod man page for more info.
As usual, i keep forgetting this important step, and keep running in to trouble.
Very useful guides are here and here.
Some guides seem to suggest that the s/w raid configuration should be put on to a /etc/mdadm.conf, but i think this is no longer necessary.
From what i've gathered, the actual RAID configurations are kept in a superblock in member physical devices. The linux kernel identifies the and reads out that information from the physical devices( partitions ), at the boot-up, and they have to be of the type 'Linux raid autodetect' OR 'fd' for this to work properly.
Friday, December 26, 2008
SL Radio channels on mplayer
Lots of Sri Lankan online radio stations seem to require Windows Media Player plugin or some other plugin when you try to access them over the Internet. Went through a couple of those radio channels finding out which urls that can be used with mplayer. Below are the findings, hope they will come to some use. I currently only listen to YesFM, and YesFM only.
YesFM -> http://174.133.224.53/yesfm
TNL Rocks -> http://220.247.224.89/live
Lite FM -> http://222.165.133.161/live
Y FM -> http://174.133.224.53/yfm
E FM -> http://69.80.238.25
Shakthi FM -> http://174.133.224.53/shakthifm
Neth FM -> http://38.96.148.49:5552
Sirasa FM -> http://174.133.224.53/sirasafm
MAX Radio -> http://75.125.239.34:7045
As an example, to listen to YesFM,
you can use mplayer http://174.133.224.53/yesfm
This link helped quite a lot in finding out the Radio Channel web sites.
Wednesday, December 24, 2008
vim stuff
note to self
I keep forgetting this, and i want to kick my self hard so i won't!!! Even then I'm not sure i won't forget this!
To append some common text to all the lines in a text file with vi/vim, below can be used.
:%s/$/some text
\t = Tab Space
Thursday, December 04, 2008
Counter-Strike 1.6 on Wine
I wanted to play this game Counter-Strike, for some time now..and yesterday i got some free time to try this out. Actually it was pretty easy to get it to work on my Fedora9 with Wine. Only thing i had to do manually was to copy this msvbvm60.dll from a M$ Windows machine to .wine/drive_c/windows/system32/
The graphics get a bit jerky when the game is starting up, and once it loads up its quite smooth.
Btw The installer wizard was filled with some strange looking characters instead of the instructions, but i guess i got the correct buttons when i clicked. Shouldn't be hard.
This would be the second FPS game i had luck with over wine., Unreal tournament being the 1st.
This would be the second FPS game i had luck with over wine., Unreal tournament being the 1st.
Friday, November 28, 2008
yum stuff
note to self
When creating yum repositories with RHEL5 installation media,
use createrepo -g with the comps-*.xml files inside {Server, Cluster, ClusterStorage, VT}/repodata directories.
createrepo -g will add the necessary meta-data on to the repo, necessary for yum group functions to work properly.
Eg. yum grouplist, yum groupinstall
Monday, November 03, 2008
Enabling basic authentication in Squid
Found this in my gmail archive and thought it would be easier to have it on my blog.
I had replied with this to someone on the lug.lk mailing list.
Actually noticed an error on my reply as well, which is corrected on the below.
-2007-08-01
Squid supports lot of authentication methods. I'll put the basic method that uses ncsa_auth program.
You need to make the following changes to your squid.conf.
Please be advised that the below, gives only a very basic proxy setup with authentication.
If you want something complex, you might want to the squid documentation.
**Backup your existing squid.conf
Put/uncomment following lines to your squid.conf
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
ncsa_auth program is installed along squid in redhat flavours, under /usr/lib/squid/ .
"/etc/squid/passwd" is the name of the file where all the passwords will be kept.
You can change this to point to wherever you want in the file system.
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
First line below is an ACL named "authenticated_user" Second line defines the networks in the LAN.
This should be changed according to your setup. ( i just copied over from def: squid.configuration :-) )
The third allows http access through the proxy for Authenticated connections coming from the specified networks.
acl authenticated_user proxy_auth REQUIRED
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks authenticated_user
Once you have made the above changes to the squid.conf you have to create the username/passwords in the specified file. ( /etc/squid/squid_passwd in this )
For that, do,
htpasswd -c /etc/squid/squid_passwd username password
After adding the 1st user in the above way, to add more new users, use the below method.
htpasswd /etc/squid/squid_passwd username password
You can find out various parameters you can use with htpasswd from the man page.
When everything is done, simply restart the squid service..
If you want squid to connect to a separate service for authentication, refer to the squid documentation, there are quite a few methods that are currently supported.
Monday, October 13, 2008
Kernel versions on different RHELs...
note to self
When ever you need to find out a kernel version of a particular RHEL version or an update, you can head over to this Knowledge Base Article. Hope they are keeping it up-to-date.
Below is what it contains right now.
| Red Hat Enterprise Linux | ||||
| Update | v. 2.1 | v. 3 | v. 4 | v. 5 |
| GA | 2.4.9-e.3 | 2.4.21-4 | 2.6.9-5 | 2.6.18-8 |
| U1 | 2.4.9-e.12 | 2.4.21-9 | 2.6.9-11 | 2.6.18-53 |
| U2 | 2.4.9-e.24 | 2.4.21-15 | 2.6.9-22 | 2.6.18-92 |
| U3 | 2.4.9-e.34 | 2.4.21-20 | 2.6.9-34 | - |
| U4 | 2.4.9-e.40 | 2.4.21-27 | 2.6.9-42 | - |
| U5 | 2.4.9-e.49 | 2.4.21-32 | 2.6.9-55 | - |
| U6 | 2.4.9-e.57 | 2.4.21-37 | 2.6.9-67 | - |
| U7 | - | 2.4.21-40 | 2.6.9-78 | - |
| U8 | - | 2.4.21-47 | - | - |
| U9 | - | 2.4.21-50 | - | - |
Old CentOS/RHEL packages
note to self
When there is a need for an old RHEL or CentOS rpm, head over to http://vault.centos.org. They keep an archive of package trees of previous CentOS releases.
It can not be used as a yum repo, but its good enough if you know what you need exactly. The security updates are not put in there, but this works for me..
--
Thank You CentOS.! :)
its rpm-build NOT rpmbuild..!
note to self
"rpmbuild" is the tool used to build rpms ( something like a .deb in Debian flavours ). Whenever i want to build a rpm on a system where i don't have rpmbuild installed, its quite easy to get it installed on the system using "yum".
The problem ( - not exactly a problem, just something that keeps on happening to me ) is that when i do "yum install rpmbuild" yum doesn't output what i need. Instead it outputs stuff which are not really even related to my requirement. The program that provides rpmbuild is named "rpm-build", which keeps causing me this problem. :(
The packages given as results from yum, when the query string is given as "rpmbuild", all seem to have the word "rpmbuild" on their "info" meta data, but its strange, and quite frankly annoying that "rpm-build" ( the actual package that provides "rpmbuild" ) doesn't have the key "rpmbuild" which could be the reason for this.
And, before i forget, the correct way would be "yum install rpm-build" :)
I hate that i keep forgetting these.!!!
Friday, October 03, 2008
port forwarding using ssh
note to self
ssh can be used in the below way to forward traffic over a secure channel, to make otherwise un-secure ( plain ) traffic to be encrypted.
ssh access to the destination sever is required for this to work.
For an example, to secure POP3 communications with a mail server at a.b.c.d one can do something like below on their local machine.
ssh -N -f -L 127.0.0.1:1100:a.b.c.d:110 user@a.b.c.d
-f is to put the connection to the background
-N to wait infinitely for incoming connections
-L binds the tunnel to the specified port ( 1100 in this case )
this will create a ssh tunnel bound to the local port 1100 with port 110 of a.b.c.d
@a.b.c.d performs the authentication via ssh with the a.b.c.d
once this is done, the POP client can be re-configured to talk to local port 1100. ssh will happily encrypt and decrypt what you put in the tunnel from the end-points. This mechanism can be used to secure systems that are not built with such capabilities.
when you want to stop the tunnel, you can simply use "kill"
--
FAQ at www.openssh.com was quite helpful in figuring this out. thanks bud for pointing out such things can be easily done with ssh. :)
Tuesday, September 02, 2008
squirrelmail preferences
Note to self
SquirrelMail keeps user specific preferences, address books in /var/lib/squirrelmail/prefs/
It annoys me, that i keep forgetting this sort of things. Hopefully i won't, again!
Subscribe to:
Posts (Atom)
changing opnsense mtu
note to self When an OpnSense is deployed on Proxmox environment where MTU is <1500, it doesn't seem to auto-detect and leaves the O...
-
Below is procedure i used in integrating squid with OpenLDAP, and the Active Directory with the information gathered from numerous google se...
-
note to self RHN doesn't seem to play well with download managers. "wget" used to be good but noticed a small problem lately...