Sunday, November 11, 2012

Linux Mint "Nadia" 14 Release Candidate dilancarkan

Sebagai pengguna Linux Mint, kehadiran versi "Nadia" amat ditunggu-tunggu. Berasaskan Ubuntu 12.10 Quantal, anda boleh dapatkan versi "Release Candidate" di sini

Saya sudah install.. disebabkan selama ini menggunakan MATE Desktop Environment, saya akan kekalkan penggunaan DE ini.



Friday, September 7, 2012

Remove Duck-duck go as search engine in Linux Mint

After you did your steps here, you may want the other short cut for finding things in the URL bar... (you know you can do this, don't you?)

We can search whatever that we need in the URL column at the browser. The default search engine is Duck Duck Go. We can change to Google by in the /home/user by deleting the .mozilla folder

To recreate again the profile, open up your browser and now the default search engine is no longer Duck Duck Go

Wednesday, September 5, 2012

Ubuntu/Mint MySQL installation problem

This is always happens when I did not use my MySQL for long and start to forget how to enable it right away. Read it here

Monday, September 3, 2012

Changing default browser in Gnome

In case you need to change the default browser in your Gnome environment;


najmi@vostro:~$ sudo update-alternatives --config gnome-www-browser
[sudo] password for najmi:
There are 3 choices for the alternative gnome-www-browser (providing /usr/bin/gnome-www-browser).

  Selection    Path                       Priority   Status
------------------------------------------------------------
* 0            /usr/bin/google-chrome      120       auto mode
  1            /usr/bin/chromium-browser   40        manual mode
  2            /usr/bin/firefox            40        manual mode
  3            /usr/bin/google-chrome      120       manual mode

Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/firefox to provide /usr/bin/gnome-www-browser (gnome-www-browser) in manual mod
e.




List all

najmi@vostro:~$ sudo update-alternatives --config gnome-www-browser
There are 3 choices for the alternative gnome-www-browser (providing /usr/bin/gnome-www-browser).

  Selection    Path                       Priority   Status
------------------------------------------------------------
  0            /usr/bin/google-chrome      120       auto mode
  1            /usr/bin/chromium-browser   40        manual mode
* 2            /usr/bin/firefox            40        manual mode
  3            /usr/bin/google-chrome      120       manual mode

Press enter to keep the current choice[*], or type selection number:


Just enter to exit.

Saturday, August 25, 2012

Creating tarball with timestamp

I have several samples of malware that I got from my Dionaea sensor. Now if somebody asked, how to get all my sample is bulky file - which is simpler to download - then I need to create a tarball.

For me, I see it's important to have a timestamp at the tarball so that I'll quickly noticed whether something screwed in my script or whatsoever.

In the same directory, there as some other files too. TXT file. So I only want to grab the MD5SUM files.

Here goes.

rm *.tar.bz2;tar cjvf `date +"%d%b%y-%H%M%p"`.tar.bz2 `ls|grep -e "[0-9a-f]\{32\}"`; gpg --passphrase infected -c *.bz2


Here,
1- It will delete the previous tarball. Since my storage is limited
2- Use tar with c flag to create bunzup. Use the appropriate timestamp. 
3- Use grep as pipe to fetch ONLY MD5SUM files
4- Use GPG to encrypt the file.
5- You may use cronjob to automate the process as you want. I created this file every day by using cron script.

The purpose of GPG is to encrypt the file, just in case any user having difficulty to download the tarball due to their anti virus blockage.


Friday, August 24, 2012

Customizing terminal theme with bashish

Feel bored with your dry looking, non intuitive PS1 terminal? Try bashish. It really rocks up to you feel wants to cry.

 
I just used the tarball from here, as the link for *.deb is dead. Just initialize "bashish" the moment you finished installed it into your system.

To use the various theming, run bashish list and bashish <your theme of choice>. Cool ha?


Friday, August 17, 2012

Installing Linux on Mac Mini

I finally decided to install Linux on Mac Mini 2009. It runs Intel Core 2 Duo and has around 1GB RAM + 100GB+ HDD storage. Yes, not a decent specs. I also planning to upgrade the RAM but since it's using DDR3 which is quite rare to find it in Lowyat, I decided to stay with the specs.

1) Since Mac is advanced enough and not relying to normal BIOS, we have to do some workaround with its EFI. What we need to do is by using rEFIt. You can use the command line installation or install by using Mac's DMG file.


2) First of all, we need to repartition the hard disk. Use bootcamp (Application->Utilities->Bootcamp). Like in my case I need to use DiskUtility as well to segregate the partition. If you plan to use GParted, you need to insert your installation CD first then reboot, after that go to your live CD session and use GParted to repartition your Mac HDD

3) Then install. For my Mac Mini, it was painfully slow. But with some patience(actually.. a lot!) I managed to install Linux Mint Maya on my Mac Mini. However, unlike Ubuntu 12.04 LTS, it does not come with Wireless Driver (I guess, propietary). Hence we need to use Ethernet cable to install it or in my case I use my phone through USB tethering. You will also noticed during the installation you need to create at least 2 partitions. One small partition, 1MB for grub installation. Another one is for your root.. and you may create your swap partition as well. In my case I created:

  • partition for Grub/BIOS
  • / (root) partition
  • /home (in case I want to change to other distro.. I can just wipe my / partition and retain this
  • swap

4) The rest is pretty straightforward.


Intel Core 2 Duo is equivalent to 64 bit architecture. If nothing was wrong you could see two processors append in /proc/cpuinfo 


You can also mount you Mac partition from your Linux. Mac is using HFS+ filesystem. If you want to automount, just edit your /etc/fstab. In the filesystem type use "hfsplus" for the filesystem option.

 


Thursday, August 9, 2012

Editing boot up service in Linux Mint

Last time when I had the "Redhat" time, I comfortably use chkconfig to edit which service to boot up at which init level.

Now that I left my old job, I don't really much bother which service starts during the boot up and what not.

In Linux Mint, you ca n use "sysv-rc-conf" to accomplish this:

Check in your repo:

$ apt-cache search sysv-rc-conf
sysv-rc-conf - SysV init runlevel configuration tool for the terminal

It's there, then install

sudo apt-get install sysv-rc-conf

Fire up the tool, 

sudo sysv-rc-conf

You will get this display:


You can toggle which service that you want to boot up in which level. As simple as that.


Have fun! Tested on Linux Maya 13 based on Ubuntu 12.04



Monday, August 6, 2012

Fetch md5sum

I dealt with a lot of Windows malware sample for my PhD work, hence I need a simple way to copy these files. Here goes

for i in `ls|grep -e "^[0-9a-f]\{32\}"`; do cp $i ~/Desktop/testbed/ -vi;done

This will basically fetch all filenames which has 32 characters (md5sum, which consist numbers and small letters a through f)

Saturday, July 21, 2012

Changing Storage Label on Linux

On Windows, you can simply right click on a device and rename it. On Linux in the other hands, you can use the following method:

During formatting, use let say if you want FAT as the filesystem:


Let say the device is located in /dev/sdc and I want it to be named as "najmi-archsight". Issue this command:

sudo mkfs.vfat  -I /dev/sdc -n "najmi-archsight"

While let say in the other hand, you already got a data inside and want to change the label, use dosfslabel:

1- If the device is mounted, unmount it first
2- Issue this command:

Let say here I want to rename the device to "najmi-csm". The device is firstly mounted at /media/B807-ED09.

najmi@vostro:~$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        47G   42G  3.1G  94% /
udev            1.9G  4.0K  1.9G   1% /dev
tmpfs           752M  1.4M  750M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            1.9G   88K  1.9G   1% /run/shm
/dev/sda6       173G  164G   12K 100% /home
/dev/sdb        2.0G  4.0K  2.0G   1% /media/najmi-archs
/dev/sdc        3.8G  2.5M  3.8G   1% /media/B807-ED09
 

Unmount first:
najmi@vostro:~$ sudo umount /media/B807-ED09/
 

Label it:
najmi@vostro:~$ sudo dosfslabel /dev/sdc "najmi-csm"
 

Check and plug back/mount the drive:
najmi@vostro:~$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5        47G   42G  3.1G  94% /
udev            1.9G  4.0K  1.9G   1% /dev
tmpfs           752M  1.4M  750M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            1.9G   88K  1.9G   1% /run/shm
/dev/sda6       173G  164G  4.0K 100% /home
/dev/sdb        2.0G  4.0K  2.0G   1% /media/najmi-archs
/dev/sdc        3.8G  2.5M  3.8G   1% /media/najmi-csm

As you can see, device /media/B807-ED09 was changed to /media/najmi-csm

Wednesday, July 18, 2012

Regular expression in bash "for" loop for file exclusion

najmi@aku-PC ~/cuba
$ touch ayam.txt ayam.csv ayam.egg

najmi@aku-PC ~/cuba
$  for i in a*[!.csv,.txt];do echo $i;done
ayam.egg


Here we use the popular ! mark to exclude the file extension within the brackets. Got the solution after few trials.

Friday, July 13, 2012

Using regexp in Linux commands

What if you have several files with same name but different extension and you want to choose only few files and leave the rests?

See the example here:

Create several files:
najmi@vostro:~/test$ touch aku.png aku.jpg aku.txt

Check:
najmi@vostro:~/test$ ls
aku.jpg  aku.png  aku.txt

New directory to separate the files
najmi@vostro:~/test$ mkdir newdir


Use {} braces to include only the specific extensions that you want to handle:
najmi@vostro:~/test$ mv aku.{jpg,txt} newdir/ -v
`aku.jpg' -> `newdir/aku.jpg'
`aku.txt' -> `newdir/aku.txt'


Check current directory
najmi@vostro:~/test$ ls
aku.png  newdir

Selected files already affected(moved)
najmi@vostro:~/test$ ls newdir/
aku.jpg  aku.txt

Saturday, June 30, 2012

Ripping Video CD (VCD)

I have a VCD which I bought years back in a year which I didn't remember. Since I want let my family watch in on TV which can be connected via USB hard disk, I want to have the copy in AVI format. So I need to rip it first.

1- Rip using K3b. If you have 2CDs, you need to create two separate folder
2- Rename the file in 2nd CD to follow the sequence of first CD.

For example; 1st CD might produce bla1.mpg, bla2.mpg. 2nd CD will have bla1.mpg also. Rename it to bla3.mpg

3- Using cat command combine them all;

cat bla1.mpg bla2.mpg bla3.mpg > all.mpg

4- Use ffmpeg to convert the combined file to AVI format

ffmpeg -i all.mpg -qscale 2 mymovie.avi


Hope it works.
 

Wednesday, June 27, 2012

VMware kernel patch for Linux Mint 13 Maya

Hi,

I tried several times running VMware player on my Mint machine to no success. Luckily a Mint user blogged it out here . I mirrored her VMware player patch so that it will have several copies here

Successfully running on my machine now. Sweet!

Tuesday, June 19, 2012

Monday, June 11, 2012

ifstat - showing real time network

Ever use ifconfig to configure or check your IP address. There is also "ifstat", the purpose is to show simple stats, and in real time the usage of your network bandwidth.

najmi@vostro:~$ ifstat -tib wlan0
  Time          wlan0      
HH:MM:SS   Kbps in  Kbps out
00:23:36     64.79     57.53
00:23:37     43.89     54.96
00:23:38     56.76     54.02
00:23:39     25.62     16.33
^C





Use CTRL+C to terminate.. as other console based tool.
Switch to -b flag to get the reading in KB or kbps


najmi@vostro:~$ ifstat -ti wlan0
  Time          wlan0      
HH:MM:SS   KB/s in  KB/s out
00:23:47      4.97      5.12
00:23:48      3.00      2.61
00:23:49      4.83      4.70
00:23:50      3.85      4.26

If this not satisfy you, check my tutorial on ntop.

Tuesday, May 29, 2012

Using Inxi to show system data

Ever know "inxi" ? This cool and console based tool is pretty handy but helps a lot.
Issuing the command with -h could help you what sort of info it could retrieve.

We can check our repositories in /etc/apt/* for example:

najmi@vostro:~$ inxi -Sr
System:    Host: vostro Kernel: 3.2.0-23-generic x86_64 (64 bit) Desktop: N/A Distro: Linux Mint 13 Maya
Repos:     Active apt sources in file: /etc/apt/sources.list
           deb http://mirror.upm.edu.my/ubuntu/ precise main restricted
           deb-src http://mirror.upm.edu.my/ubuntu/ precise main restricted
           deb http://mirror.upm.edu.my/ubuntu/ precise-updates main restricted
           deb-src http://mirror.upm.edu.my/ubuntu/ precise-updates main restricted
           deb http://mirror.upm.edu.my/ubuntu/ precise universe
           deb-src http://mirror.upm.edu.my/ubuntu/ precise universe
           deb http://mirror.upm.edu.my/ubuntu/ precise-updates universe
           deb-src http://mirror.upm.edu.my/ubuntu/ precise-updates universe
           deb http://mirror.upm.edu.my/ubuntu/ precise multiverse
           deb-src http://mirror.upm.edu.my/ubuntu/ precise multiverse
           deb http://mirror.upm.edu.my/ubuntu/ precise-updates multiverse
           deb-src http://mirror.upm.edu.my/ubuntu/ precise-updates multiverse
           deb http://mirror.upm.edu.my/ubuntu/ precise-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
           deb-src http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
           deb http://extras.ubuntu.com/ubuntu precise main
           deb-src http://extras.ubuntu.com/ubuntu precise main
           deb-src http://mirror.upm.edu.my/ubuntu/ precise-backports main restricted universe multiverse
           deb http://packages.linuxmint.com/ maya main upstream import
           deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ precise partner
           deb http://packages.medibuntu.org/ precise free non-free


And.. some other info


$inxi -b
System:    Host: vostro Kernel: 3.2.0-23-generic x86_64 (64 bit) Desktop: N/A Distro: Linux Mint 13 Maya
Machine:   System: Dell (portable) product: Vostro 3400 version: A10
           Mobo: Dell model: 0RXV7H version: A10 Bios: Dell version: A10 date: 10/25/2010
CPU:       Dual core Intel Core i5 CPU M 480 (-HT-MCP-) clocked at 1197.00 MHz
Graphics:  Card-1: Intel Core Processor Integrated Graphics Controller
           Card-2: NVIDIA GT218 [GeForce 310M]
           X.Org: 1.11.3 drivers: intel (unloaded: vesa,fbdev) Resolution: 1366x768@60.1hz
           GLX Renderer: Mesa DRI Intel Ironlake Mobile GLX Version: 2.1 Mesa 8.0.2
Network:   Card-1: Realtek RTL8111/8168B PCI Express Gigabit Ethernet controller driver: r8169
           Card-2: Broadcom BCM4313 802.11b/g/n Wireless LAN Controller driver: brcmsmac
Drives:    HDD Total Size: 820.2GB (47.6% used)
Info:      Processes: 193 Uptime: 21:11 Memory: 1961.8/3755.8MB Client: Shell inxi: 1.7.33

Have fun!

Monday, May 28, 2012

Linux Mint 13 "Maya" Released

Linux Mint 13, codename "Maya" was just released last week. It is based on Ubuntu 12.04 LTS which means it will be supported until year 2017!

More info can be read here

Which regards to the comparison of it's interface, MATE and Cinnamon can be read here

For me I downloaded the Cinnamon version since last time I used "Mate" [I believe so].. at the end I decided to have both co-exist on my system. Seems I am so used to Mate.

If you already use Cinnamon and want to move to Mate, simply issue this command :

sudo apt-get install mint-meta-mate -y