Tampilkan postingan dengan label GNU/Linux. Tampilkan semua postingan
Tampilkan postingan dengan label GNU/Linux. Tampilkan semua postingan

Sabtu, 30 Juni 2012

Create Virtual Interface in Your Ubuntu Machine

Im trying now to get my machine to run 2 virtual hosts in Apache. This is part of my favor to my friends actually.

So, first thing first, I need to create virtual interface to my loopback. Manually, I will type this in:

yuvi@yuvi:~$ sudo ifconfig lo:0 192.168.1.1 255.255.255.0 up
[sudo] password for yuvi: 
SIOCSIFADDR: Invalid argument
yuvi@yuvi:~$ ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:336 errors:0 dropped:0 overruns:0 frame:0
          TX packets:336 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:30943 (30.9 KB)  TX bytes:30943 (30.9 KB)

lo:0      Link encap:Local Loopback  
          inet addr:192.168.1.1  Mask:255.255.255.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1

yuvi@yuvi:~$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.045 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.030 ms
^C
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.030/0.037/0.045/0.009 ms

Can see now it's up, i can ping successfully. 

Problem is, when I reboot, it's not there anymore. So, to make this permanent, have tried adding in 

yuvi@yuvi:~$ more /etc/network/interfaces 
auto lo
iface lo inet loopback

#Virtual Interface
auto lo:0
iface lo:0 inet loopback
address 192.168.1.1
netmask 255.255.255.0

But same result, it still doesnt go up. My boot.log and syslog didnt tell me anything, so ... I think I can go with crontab:

yuvi@yuvi:~$ sudo crontab -l
@reboot ifconfig lo:0 192.168.1.1 255.255.255.0 up

And ..... bingo, it still doesnt work, dont know why ... please tell me why if anyone knows ...

So, move to other alternative, create an rc script:

root@yuvi:/etc/init.d# more IfUplo 
#!/bin/bash
ifconfig lo:0 192.168.1.1 255.255.255.0 up
echo "Virtual Interface Loopback Up"

root@yuvi:/etc/init.d# ls -ls IfUplo 
4 -rwxrwxrwx 1 root root 93 2012-06-30 09:20 IfUplo

root@yuvi:/etc/init.d# update-rc.d IfUplo defaults
root@yuvi:/etc/init.d# locate IfUplo 
/etc/init.d/IfUplo
/etc/rc0.d/K20IfUplo
/etc/rc1.d/K20IfUplo
/etc/rc2.d/S20IfUplo
/etc/rc3.d/S20IfUplo
/etc/rc4.d/S20IfUplo
/etc/rc5.d/S20IfUplo
/etc/rc6.d/K20IfUplo
/var/lib/update-rc.d/IfUplo

Please bear in mind that this script does give me an error of not complying with LSB ... small script, doesnt really matter. So there, it creates links for me in all rcs directories:

Reboot and ..... yesss it works.

Change Your Default Boot Selection

After messing around with kernel 3.2, trying to get my machine running on:

yuvi@yuvi:/boot/.bak$ uname -a
Linux yuvi 2.6.35-32-generic #64-Ubuntu SMP Tue Jan 3 00:47:07 UTC 2012 x86_64 GNU/Linux

to recognize beceem wimax chipset with no luck, well, at least until now, my boot list is now like a scrambled eggs, see this boot.cfg below, count how many entries i've get, now im desperately trying to get rid of it. I've tried moving all the images in /boot and run grub-mkconfig afterwards ... doesnt work.

It took me a while to notice just this line:
set default="0"
in grub.cfg and change it to 2 and by default, it goes directly to my third entries as default.

I know there is much cleaner way to update default entry for boot, but ... to be honest playing around with this is much more fun ;)

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 3.2.0-030200-generic' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-3.2.0-030200-generic
}
menuentry 'Ubuntu, with Linux 3.2.0-030200-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-3.2.0-030200-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-32-generic' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-2.6.35-32-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-2.6.35-32-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-31-generic' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-2.6.35-31-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-31-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-2.6.35-31-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-30-generic' --class ubuntu --class gnu-linux --class gnu --class os {
...... initrd /boot/initrd.img-2.6.35-30-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-30-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
....... initrd /boot/initrd.img-2.6.35-30-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
....... initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
......  initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###


Sabtu, 02 Juli 2011

Some Ubuntu Keyboard Shortcuts

Having used to keyboard shortcuts in Windows, does push me to find more of various keyboard shortcuts in Ubuntu. I'm using Ubuntu from recently, around 2 - 3 months ago. 

Workspaces:
1. To move an active window to another workspace : CTRL - ALT - SHIFT - Left/Right Arrow. Why do we need this? Sometimes, we found it too many open windows in one workspace and it comes in handy to be able to organize it a lil neater.
2. Moving between workspaces : CTRL - ALT - Left/Right Arrow

3. When there is no mouse and you need to click on something in the top panel, bottom panel or an icon in the desktop, you can use this shortcut : CTRL - ALT - SHIFT - TAB. Ubuntu will show  you the choice, whether it's top or bottom or desktop, and then after one is selected, you can use left/arrow button to choose an icon. Beside this combination, CTRL - ALT - Esc also works.

4. To show desktop, use Windows button and D

5. If you notice, there is a message pane in the top right corner, it contains chat, broadcast accounts and so on, so to choose this, we can use Windows button and M then use arrow down/up to select specific item.

6. Sometimes, we need to access the virtual screen just in case the X window somehow crashes. We can use combination CTRL - ALT - F7 / F8

7. CTRL - ALT - L to lock window

8. CTRL - SHIFT - F10 to give right click mouse effect

9. CTRL - SHIFT - N to create new folder anywhere

10. Last but not least, you can always assign keyboard combination on your own. Like myself, Im assigning CTRL - ALT - T to open up terminal and CTRL-D to open Home Folder

Selasa, 03 November 2009

Perjalanan dari Windows Menuju RedHat

Sekedar sharing untuk pengguna RHEL 5.

Saya baru install rhel versi 5, dual boot dengan Windows XP, pengen porting [lagi] dari Windows ke GNU/Linux hehehe.

Tantangannya yaitu:
1. Pastinya memastikan ethernet card dikenali dan bisa digunakan. Untungnya, modul ethernetnya langsung dikenalin jadi ga perlu repot2 udah langsung tinggal configure ip address plus sudo ifup hehehe

2. Mengenalkan zte modem yang akan digunakan untuk connect ke internet kalo lagi ngga di kantor. ZTE modemnya tipe MF622 yang berfungsi ganda, yaitu sebagai storage dan sebagai modem. Kalau di Windows, pada saat pertama colokin, pasti akan dikenali sebagai removable disk terlebih dahulu baru kemudian setelah aplikasi dialernya dijalankan, fungsinya akan berubah menjadi modem. Pada GNU/Linux, yang dilakukan mirip dengan yang di Windows, yaitu membuatkan aturan baru di udev.d kalau ada modul storage ZTE tersebut langsung dideregister lalu diswitch ke USB modem. This is pretty simple for me karena udah ada yang berbaik hati bikinin rules duluan jadi tinggal copy aja hehe ... http://pfesto.blogspot.com/2008/09/zte-mf622-e61i-and-wimode-on-fedora.html.

3. Bikin repo lokal :D, thanks to rito (http://blog-rito.blogspot.com/). Awalnya bikin repo dari CD Installer RHEL5 yang dipake buat install, tapi terus terpikir, kan paketnya aku install semua pada saat awal, jadi ngga ngaruh juga :)) ... akhirnya aku bikin repo dari CD installer Fedora yang aku pinjem dari Rito juga. Cuma sayangnya, paketnya mirip2 deh ... jadi, terpaksa bikin repo dari kambing.

[root@localhost ~]# cat /etc/yum.repos.d/master
[master]
name=master
baseurl=ftp://kambing.ui.edu/centos/5.4/os/i386/
mirrorlist=file:///etc/yum.repos.d/local.mirror
enabled=1
gpgcheck=0


4. Install2 aplikasi hiburan yang biasa dipake sehari2:
- pidgin
- xine
- realplayer

Agak ribet ya pasang xine-nya. Kalau pasang libxine justru gampang, tinggal yum search hehehe. Masalahnya adalah pada saat pasang xine-ui, maklum amatir :D, bolak balik ./configure, soalnya somehow libxine-nya ngga dikenalin :sigh:
Pas pake xine-ui, libxinenya yang ga dikenalin, karena berbagai macam option configure sudah dicoba, khususnya option CPPFLAGS sama LIBFLAGS ngga ngaruh juga, akhirnya download kaffeine (inget ini soalnya mas tisna pake hehe). Sama juga kasusnya, banyak banget dependenciesnya. Udah install satu2, stuck juga di flag yang sama ... weks.
Pindah ke gxine, sama juga, malah baca2 di forum, makefilenya ada bugnya, manggil function yang ngga ada di header file.
Akhirnya balik lagi ke xine-ui dan coba - coba lagi ganti2 option configure. Hehehe akhirnya berhasil juga.
$ ./configure XINE_LIBS=/usr/local/lib/libxine.so XINE_CFLAGS=/usr/local/include/xine.h --with-readline

One down, udah bisa maenin VCD dan AVI di xine, dan maenin mp3 di real player :D.
Kalo pas install real player ngga terlalu susah kok, tinggal download rpm nya hehehe.
Begitupun pas install pidgin, ga ribet.
Hemmm pas ditulis cuma jadi 1 blok, padahal ngerjainnya 1 hari nih #^%&#^%)@^&$)(@^%*

4. Yang keempat, karena semua data udah terlanjur ada di NTFS partition, berarti aku harus install ntfs kernel module biar bisa mounting. Nah, biar bisa read write, sekalian deh, dipasang ntfs-3g. NTFS-3g butuh fuse dan dkms-fuse (dynamic kernel module) biar bisa dijalanin, karena kalo ngga, pas mounting akan error.
Selesai pasang ntfs-3g, tinggal edit /etc/fstab, bikin auto biar ngga perlu mounting bolak balik.

5. Pasang OpenOffice. Ingat, sekarang counterpart kita adalah Office 2007, jadi OpenOfficenya juga harus versi 3 biar bisa dibaca. Yang ini juga amat sangat gampang, tinggal download dari openoffice.org, selesai deh.

6. Jangan lupa, pasang VMware hehe. VMware workstations yang versi opensource free kok, bisa langsung didownload di websitenya VMware. Buat yang gila debugging, jangan lupa pasang eclipse biar kalo error bisa ditrace.

7. Import semua email dari Microsoft Outlook ke Thunderbird. Kenapa pilih Thunderbird? Soalnya di google dibilang, thunderbird adalah yang paling banyak digunakan, simply that :D, kekurangannya, ga bisa pasang calender, kalo mau pake calendar, harus pake Evolution. Blom coba sih, bisa import dari Thuderbird ke Evolution apa ngga. Yang jelas, untuk import dari MS Outlook ke Thunderbird, kita harus pasang dulu Thunderbird di Windows, import semua email dari MS Outlook ke Thunderbird di Windows, baru deh copy semua file mailboxnya ke folder yang akan digunakan oleh Thunderbird di Linux. Biasanya extensionnya .msf.

8. Pasang httpd, karena pas di awal udah install semua package, jadi tinggal dinyalain ajah hehehehe

9. Edit file sudoers.

10. Pasang wireless adapter. Nah ini yang ngga bisa :D, dari kemarin stuck nih. Buat temen2 yang udah pengalaman mohon arahannya. Yang jelas modul nya udah dikenalin.

[root@localhost ~]# lsusb
Bus 002 Device 003: ID 19d2:0001 ONDA Communication S.p.A.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 003: ID 0402:5606 ALi Corp. USB 2.0 Camera
Bus 001 Device 002: ID 0bda:8189 Realtek Semiconductor Corp. RTL8187B Wireless 802.11g 54Mbps Network Adapter
Bus 003 Device 001: ID 0000:0000
[root@localhost ~]# lsmod | grep rtl8187
rtl8187 34497 0
mac80211 137545 1 rtl8187
cfg80211 30793 2 rtl8187,mac80211
eeprom_93cx6 6337 1 rtl8187
[root@localhost ~]# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
vmnet1 no wireless extensions.
vmnet8 no wireless extensions.
ppp0 no wireless extensions.
[root@localhost ~]# ifup wlan0
/sbin/ifup: configuration for wlan0 not found.


Sama pendingan satu lagi, suara sih keluar dari speaker internal, tapi ngga bisa keluar lewat headphone, kenapa ya :D. Kalo headphone dicolokin, speakaer ngga bunyi, tapi tetep ga ada suara yang keluar lewat headphone.

Update status per hari ini, 9 Nov 09. Ternyata, masalah ga bisa bunyi kalo pake headphone, bukan masalah driver and the likes ... instead, it is just a configuration matters. Aku coba - coba kemarin, semua options dibuka2in, dan untuk surround, aku ngga mute ... ehhhh ternyata bunyi loh di headphone :)) ... katro deh.

Jadi, skrg tinggal gimana caranya agar wlan0nya kedetect. Btw, thanks to rito, redhat ku skrg centos flavour :D. Mengikuti saran rito, redhat aku yum-update menggunakan reponya centos, walhasil sekarang centos flavour :D.

Jumat, 11 September 2009

Cron task in 5 minutes

Wanna run scheduled task in Linux using cron task, but you're having problem in reading the bulky tutorial?

This should work in only 5 minutes:

[root@VM-FC10 etc]# more /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

/etc/cron.hourly itu adalah direktori, jadi untuk yang mau dikerjakan setiap jam, taruhlah di direktori ini. jangan lupa, bahwa semua script yang ada disini, harus merupakan shell script.

nah, yang banyak bintang2nya itu adalah penunjuk waktunya, sebagai berikut:
menit jam tanggal bulan hari command
hari diisi dengan angka 0 sampai 7 dengan 7 berarti hari Minggu

bagaimana kalo kita ingin menjalankan task yang ngga ada di pola diatas? ya tinggal ditambah aja hahahaha ..

tambahnya di /etc/cron.d/ dan sintaksnya sama dengan crontab diatas

gampang kan? yang susah shell scriptnya :D

Kamis, 20 November 2008

Quote of the Day - Linux Challenges

Two forces in particular are driving changes to Linux. One is a push to develop Linux into a standard, more predictable platform for developers and users. The other is to leverage Linux, and open source in general, as mediums through which innovation gets delivered to users.