Posts

Showing posts from 2008

UPDATE: How to run Opensolaris in Virtualbox

Well, my last article about virtualbox and opensolaris is outdated.why?because the new vbox(2.1.0) version replace TUN/TAP on Linux. What does that mean? You don't need anymore a tun/tap interface. You can attach to a real interface as eth0, eth0:1, br0, or another "real" interface. So, my bash script is useless now. Anyway, to update your virtual opensolaris, run this command: VBoxManage modifyvm "opensolaris" -nic1 hostif -hostifdev1 eth1 More info about virtualbox 2.1.0 here That is all :)

Old lady

Image
97 years old lady

How to run opensolaris in virtualbox

Opensolaris in virtualbox, short how to 0 - what do I need to run virtualbox 1 - creating the image 2 - disk management 3 - vm management(start stop), delete vm, monitoring 4 - snapshot 5 - short_how_how 0 - to run opensolaris you need: - linux, duhhh:) - virtualbox Version 2.0.6 - tunctl (uml-utilities) - brctl (bridge-utils) and this script (run it from root account) #!/bin/bash PATH=/sbin:/usr/bin:/bin:/usr/bin USER=dbordeanu IPTABLES="/sbin/iptables" /usr/sbin/brctl addbr br0 #tap 1 for opensolaris #ip 10.1.1.2 /usr/sbin/tunctl -t tap1 -u $USER ip link set up dev tap1 /usr/sbin/brctl addif br0 tap1 #start br0 ip link set up dev br0 ip addr add 10.1.1.1/24 dev br0 ip route add 10.1.1.0/24 dev br0 chmod 0666 /dev/net/tun 1 - Creating the opensolaris image - creating the image: VBoxManage createvm -name "opensolaris" -register - specify the ram, boot order, and the net interface VBoxManage modifyvm "opensolaris" -memory "512MB" -acpi on -boot...

How to enable ip forward in opensolaris

Well, you think this task is simple, like in linux, where you type in a console "echo "1" > /proc/sys/net/ipv4/ip_forward" In opensolaris this task is more complicated. Why?because, they can :) root@opensolaris:/net# uname -a SunOS opensolaris 5.11 snv_101b i86pc i386 i86pc Solaris to check if the ip forward is enabled type: root@opensolaris:/net# svcs -a | grep forward disabled 10:24:40 svc:/network/ipv6-forwarding:default disabled 12:46:49 svc:/network/ipv4-forwarding:default in this case, it is disabled (by default) To enable it, you can do: - root@opensolaris:~# ifconfig pcn0 router for ipv6: root@opensolaris:~# ifconfig pcn0 inet6 router - root@opensolaris:~# ndd -set /dev/ip ip_forwarding 1 for ipv6: root@opensolaris:~# ndd -set /dev/ip ip6_forwarding 1 - In the previous Solaris releases root@opensolaris:~# routeadm -e ipv4-forwarding for ipv6: root@opensolaris:~# routeadm -e ipv6-forwarding To disable ip forward root@opensolaris:~# ifconfig ...

bash script to check left space on device

This is a very simple bash script intended to be used for checking the space on every partition from your hardisk #!/bin/bash PROG_NAME="space_usage" #Set usage USED_SPACE="95" #log file if you want to use log file LOG_FILE="space.txt" #email address EMAIL="user@localhost" SEND_EMAIL="N" #crontab every night at 12 #0 0 * * * root space.sh function log() { /usr/bin/logger -i -p kern.crit -t ${PROG_NAME} "UPSS: ${i[5]} has used more than $USED_SPACE % space" echo "UPSS: ${i[5]} has used more than $USED_SPACE % space" >> $LOG_FILE #send email if [ $SEND_EMAIL == 'Y' ] then mail -s "no more space on ${i[5]} " $EMAIL fi } #grep mounted partitions df -k -P --sync |grep -v "Mounted" | while read i; do i=( ${i} ) #echo mounted partitions #echo ${i[5]} USED=`df ${i[5]} | awk '{print $5}' |grep -v "Use%" | cut -f1 -d%` #...

BitDefender RescueCD

The BitDefender Unices team is re-mastering a rescue cd based on Knoppix Live CD. The re-mastered CD will be capable of scanning and disinfecting all your existing hard drives (including NTFS partitions) before your OS boots. To use this RescueCD, you need to be familiar with a few basic notions, such as: what is a partition and what type of internet connection you have. Another condition would be that you should not be afraid to use the console to type commands and read the manual. The new CD will provide a few tools for data rescue, partition size changes and basic forensic networking. Its main feature is that after the boot, all detected and mounted partitions on your hard drive will be automatically scanned by our antimalware scanner, bdgui. Bdgui is a frontend for bdscan and it was designed to make the disinfection procedure easier for the common user. Plus it looks cool :-). More info here: http://unices.bitdefender.com/?p=12 If you want to download the iso go here : http://dow...

How to disable Talk in Mediawiki

MediaWiki is a free software wiki package originally written for Wikipedia. I'm using mediawiki to document my projects. Anyway, if you want to disable Talk in media wiki follow the next steps. cd your_mediawiki_dir/include cp SkinTemplate.php SkinTemplate.back (just in case) mcedit/vi SkinTemplate.php search for <strong>$content_actions['talk']</strong> uncomment this line /* $content_actions['talk'] = $this->tabAction( $talkpage, 'talk', $this->mTitle->isTalkPage() && !$prevent_active_tabs, '', true); */ The end :)

bad blocks on my hard drive

Not a good day for science. One hard drive from my data server is not working right.Sometimes the system stops responding. Well, to check for badblocks just use smartctl , ofcourse your hdd must know about smartctl.To check use hdparm [...] hdparm -I /dev/hda [...] Commands/features: Enabled Supported: * SMART feature set [...] To see if Checking blocks 0 to 78150744 Checking for bad blocks (read-only test): 23267840/ 78150744 23489984/ 78150744 done Pass completed, 0 bad blocks foundthe hdd is ok run: smartctl -t long /dev/hda In order to check for badblocks run: badblocks -sv /dev/hda If you get something link this: Checking blocks 0 to 78150744 Checking for bad blocks (read-only test): 23267840/ 78150744 23489984/ 78150744 done Pass completed, 0 bad blocks found. ...you are lucky, if not, well...bad day for you :(

When your favorite wireless app is not working

Nowdays, all laptops have wifi cards, and if you have an old laptop you can buy a pcmpcia card,or you can try a USB wifi card ( TL-WN321G ) In linux, you have a lot of wifi manager apps.You can read more about them here But sometimes none of them are working and it's impossible to connect to a free public AP.So, back to the console :) 1- Free AP - to scan for wireless AP in my case, ath0 is the wifi card (i'm using a smc card with atheros chipset, Atheros Communications, Inc. AR5212 802.11abg NIC) iwlist ath0 scanning the result of wifi scanning myust be something like this : ath0 Scan completed : Cell 01 - Address: 00:00:00:00:00:00 ESSID:"free host spot" Mode:Master Frequency:2.437 GHz (Channel 6) Quality=45/70 Signal level=-50 dBm Noise level=-95 dBm to connect to this hot spot type : iwconfig ethX essid "free hot spot" In order to check if you are connected...

How to compile php5 with oracle instant client 11

Well, this is very easy. First you need to download apache web server ,the latest php 5.2.6 from www.php.net and the instantclient11 from oracle download (you need an accont for this one) Unpack your apache archive in your work dir and then type ./configure --enable-so --with-mpm=prefork --enable-ssl=static --with-ssl=/usr/include/openssl/ If all is ok, type make , and after this make install This will install the http server in /usr/local/apache2 dir If you want to have php with oracle instantclient11, unpack the php archive on your disk and type: './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql' '--with-gd' '--with-zlib' '--with-oci8=instantclient,/opt/instantclient_11' '--enable-bcmath' '--with-sqlite' '--with-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--enable-mbstring' '--with-mcrypt' Offcourse, you must unpack the oracle instantclient11 zip file i...

Why sometimes oracle 10g XE sucks big time

A few days ago, one of my web application that use as backend oracle (i'm running oracle-xe-10.2.0.1-0.1) hangs and refuse to work. I was very surprised of this, because i was more than sure that i did not made any modifications on my web server. First thing i look into it was the apache web server.I try to restart the web server, check the php lib file to see if it is corrupted or missing, check the ORA_HOME enviroment, check it the DMZ server where the oracle 10XE is running respond to my pings and telnets in 1521.Every thing was working as espected, except my web application.I was very frustrated and disappointed. After a while, it hit me, why not check the sqlplus client from ORA_HOME path. Tannnnaaaa...this was the problem.The sqlclient refuse to work or connect to the oracle server. This is the output of the strace that i did on sqlplus \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256 13100 lseek(6, 512, SEEK_SET) = 512 13100 read(6, "\337y \0\0\0\0\0\0\0\0\0\0\...

postfix with bitdefender-scanner

In this post i'll describe to you, how to scan emails using postfix and BitDefender-scanner . This will help you scan and clean all incoming email traffic to your server for viruses. Nevertheless, this sollution is not a fast one(and it will scan only the incoming mail), because for each and every mail, the procmail filter will send the eml to the bitdefender-scanner. In order to increase speed, i recommand to use BitDefender for mail servers , and integrate it with postfix or other favorite mta. Bitdefender-scanner it is very easy to install.The package will cam as, rpm, deb and tar. Just type in your console sh -x BitDefender-scanner.rpm/deb/tar.run and follow the install procedure. After the install, I recommend to update your scanner.To do this, go to /opt/BitDefender-scanner/ bin, and type . /bdscan --update If you LDA in postfix is procmail, then you don't need to make any modifications to your main.cf file.If not just add this line in / etc/postfix/main....

O.M.D onlinemedical software database

- OMD What is OMD "Online medical data base it is an online managemt tool for medical purposes..." Click here for wiki page. For a quick demo press here Enjoy :)

Drug weblist

This is related with OMD project. This simple application contain the commercial drug list from romanian market. It contain a search module that can perform search with a specified criteria(name, country etc). Here it is