Archive for the ‘tips & tricks’ Category

how to install yum into centos 5

June 22nd, 2008 3:34 am

orait, got centos 5 vps/dedicated that don’t have yum installed?? enough doing googling but yet not find any WORKING solution?? (i hope so… haha)

actually last night my friend ask me to configure his centos vps which is dont have yum (i know, i’m noob and i cant work centos out without YUM)

so, here is the quick way to install YUM-my package manager in less then 10 minutes

download all this shit rpms into one folder name “yummy”

wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/m2crypto-0.16-6.el5.1.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-elementtree-1.2.6-5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/rpm-python-4.4.2-47.el5.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-3.0.5-1.el5.centos.5.noarch.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.0-8.fc6.x86_64.rpm
wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/sqlite-3.3.6-2.x86_64.rpm

(my friend server is 64bit, if your server is 32bit, just replace x86_64 with i386

example: http://mirror.centos.org/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.1.i386.rpm

good, now we are going to install all those rpms

rpm -Uvh *.rpm

if this not working, just install those rpms one by one.

wallah, now it’s done. you can type yum now!

note: if you got this error Could not find any working storages.

try this magic command line

rpm -Uvh --replacepkgs sqlite-3.3.6-2.x86_64.rpm

important security tips when uploading screenshot

March 18th, 2008 8:30 am

if you planning on uploading your screenshot to show something about your computer, program, sofware or anything, make sure you always doublecheck it. make sure there is no information that can be use by somebody. what kind of information should be protected?? ALL

sometimes we tend to upload screenshot without knowing that there’s half part of our password there (just example) and this could leak to a password guessing attack.

evenmore, maybe it’s a code. you take screenshot piece of your program code, while leaving small portion of other “important secret codes revealed” - beware of people with sharp eyes, they will notice it. a secret foldername on you website also could be on it. so, here’s a simple precaution that you cant take before upload your screenshot/photo.

rule no 1: make sure there’s no sensitive information on your screenshot.

rule no 2: make sure there’s no sensitive information on your screenshot.

rule no 1 and 2 mean double check!

the best practice is that, always take screenshot while other application stay mimimized. it’s wiser if you crop it at the important part of that you want to show only. focus the important part.

if you like to upload screenshot like i’m doing for my funny screenshots, you better check them before somebody used informations on it for bad purpose!!

dont be suprise if someday you found your blog was defaced by somebody, then you blamed your vuln cms. you dont want think like this to happend right? so always be carefull, but please don’t be paraniod like sfx.

this is also known as human stupidity exploit and there’s no specific patch for it!

till then, take care!

ubuntu for engineering student

January 24th, 2008 1:52 pm

today i got a lots of assignment that require me to use software like maple, ps-pice and matlab. all this softwares are available in windows. what about ubuntu or other linux distro??

since i’m currently on my record attemp to make a one month uptime with my ubuntu so don’t want to reboot into windows. there must be a program/software that can be use in linux for my assignments.

so, after googling for while i found this wiki-page about tools that can be used for my engineering project. if you are an ubuntu user, check it this out

https://help.ubuntu.com/community/UbuntuScience

look like i can forget windows after this…can i???

simple alarm clock with bash scripting

January 14th, 2008 12:58 pm

here is a simple bash programming that will execute alarm when it reach certain time setup by user

initially i coded just for exercise on bash scripting (practice make perfect right?) but i think it’s a good idea to share it with other people

here’s the code
#!/bin/bash
masa="`date +%k:%M`"
mp3="$HOME/Desktop/alarm.mp3" #change this


if [ $# != 1 ]; then
echo “please insert alarm time [24hours format]”
echo “example ./alarm 13:00 [will ring alarm at 1:00pm]”
exit;
fi
alarm=$1
if [[ "$alarm" =~ ^[0-2][0-9]\:[0-5][0-9]$ ]]
#fix me with better regex >_<
then
echo “time now $masa”
echo “alarm set to $alarm”
echo “will play $mp3″
else
echo “invalid clock format”
exit;
fi


while [ $masa != $alarm ];do
masa=”`date +%k:%M`” #update time
done
echo $masa
if [ $masa = $alarm ];then
echo ringggggggg
play $mp3 > /dev/null 2> /dev/null &
fi
exit

if you have any suggestion/comment to improve this code please tell me :D

thanks

view proper script alarm bash script

note : you will need sox to use “play” command, debian/ubuntu user can install it by sudo apt-get install sox

share internet connection with linux

January 7th, 2008 3:09 pm

since i can’t afford to use 3G connection at UTM so i’m online through public hotspot at my hostel. even it’s not so realiable due to many downtime but it’s better then no connection at all right?

my roomate using desktop pc so he have to buy wireless adapter if he want to use the wifi too.
the cheapest wireless adapter will cost around rm 60-70.

since i alway turn my laptop on (it’s hot but i don’t care) so i told him to find a lan cable for pc to pc connection.
then do a little trick with my ubuntu which is ip masquerading

$sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

eth1 is my wifi card interface, my roomate pc connected to lan network card on eth0

my laptop eth0 setting
ip address : 192.168.1.1
netmask : 255.255.255.0

configured my roomate pc with setting
ip address : 192.168.1.2
netmask : 255.255.255.0
gateway : 192.168.1.1
dns : 161.139.250.2 (utm’s dns)
you must put the dns so that you can surf website.

that’s it. cheap and easy way to get connected. one meter lan cable will only cost you 90 cent

added : make sure you enabled ip forwarding

$echo 1 > /proc/sys/net/ipv4/ip_forward

or put net.ipv4.ip_forward=1 in your /etc/sysctl.conf if you want it to be permanent

p/s: iptables rule set will disappear after reboot

recommended reference : Internet Connection Sharing Server 2 nic cards


who's online