Wednesday, October 12, 2011

OPHCRACK reset windows password (vista,7,xp)

Download the LIVE CD and burn it.

1. Boot your computer with the LIVE CD.
2. Choose graphic mode - automatic.
3. It will load the GUI of ophcrack and will run the service.
- In few cases, it will prompt you "not tables found". To solve this, you need analyze your computer.
1. right click on the desktop and go to terminal.
2. in the terminal, use root as the user. Type "su" and the password is "root"
password: root
3. list the mount info. Type "ls /mnt". This will display your filesystem.
#ls /mnt
sda2 sda3
4. Type "df" to check which filesystem is using windows system(where your windows is installed. In our example, windows system is installed on sda2.
5. Mount the your cdrom to the filesystem that is using windows system. Type "mount /dev/cdrom /mnt/sda2"
6. After mounting, run the again.
7. You're done!
4. Wait for OPHCRACK to recover your password.
5. After some time (depending on the strength of your password), it will show you the password.

Monday, September 12, 2011

GPG Error / NO_PUBKEY Debian 6.0 Squeeze

If you encounter the following error when updating, I listed below the steps to fix it.

"W: GPG error: squeeze/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA"

1. check all the keys installed on your server for debian repository.
$apt-key list

2. Install the debian-archive-keyring.
$apt-get install debian-archive-keyring

#You should be able to see the following:
pub 4096R/B98321F9 2010-08-07 [expires: 2017-08-05]
uid Squeeze Stable Release Key

pub 1024D/F42584E6 2008-04-06 [expires: 2012-05-15]
uid Lenny Stable Release Key

pub 4096R/55BE302B 2009-01-27 [expires: 2012-12-31]
uid Debian Archive Automatic Signing Key (5.0/lenny)

pub 2048R/6D849617 2009-01-24 [expires: 2013-01-23]
uid Debian-Volatile Archive Automatic Signing Key (5.0/lenny)

pub 4096R/473041FA 2010-08-27 [expires: 2018-03-05]
uid Debian Archive Automatic Signing Key (6.0/squeeze)

3. Update your Debian server now.
$apt-get update

Another Case:
Incase you encountered the error below.
"W: GPG error: testing Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907"

$apt-get install debian-multimedia-keyring

3. You can now execute your update
$apt-get update

If it doesn't work try this!

rm /var/lib/apt/lists/* -vf
apt-get clean
apt-get update

Another Case:

W: GPG error: squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907
W: GPG error: squeeze-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 07DC563D1F41B907

#Insert below in your /etc/apt/sources.list.

deb squeeze main non-free
deb squeeze-backports main

#Add Key
apt-get install debian-keyring
gpg --keyring /usr/share/keyrings/debian-keyring.gpg -a --export 07DC563D1F41B907 |apt-key add -

Another Case:
"W: GPG error: squeeze Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62"

#Insert below in your /etc/apt/sources.list.
deb stable all

#Add Key
gpg --keyserver --recv-key ABF5BD827BD9BF62
gpg -a --export ABF5BD827BD9BF62 | apt-key add -
apt-get update

Another Case:

W: GPG error: stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E9C74FEEA2098A6E

#Insert below in your /etc/apt/sources.list.
deb stable all

#Add Key
cat dotdeb.gpg | apt-key add -
rm dotdeb.gpg

Thursday, September 8, 2011

sources.list for Debian Squeeze 6.0

deb squeeze main non-free
deb-src squeeze main non-free

deb squeeze/updates main
deb-src squeeze/updates main

deb squeeze-updates main
deb-src squeeze-updates main

deb squeeze main non-free
deb squeeze-backports main

deb squeeze nginx
deb-src squeeze nginx

deb stable all

Friday, August 12, 2011

How to Round in a linux command?

Linux has a built-in command for rounding numbers. It's using the "printf" functionality.

Below are the examples:

$printf "%.0f\n" "69.51"

$printf "%.0f\n" "69.41"

Wednesday, July 27, 2011

How to log iptables on a separate file or directory in linux (debian 6.0)

Is it a pain when you are viewing your iptables logs from you system logs (syslog/messages/kernel)?

The solutions for this is to put your iptables logs to a different file.

In Debian 6.0, you can do this by using rsyslog. (If you don't have it in your server, you can install it by using apt-get. "apt-get install rsyslog")

Here are the steps:

1. You need to create a configuration file for iptables. Go to the rsyslog directory.
$cd /etc/rsyslog.d
$nano iptables.conf

2. Inside your configuration file you need to add the following. Just modify the part inside the double quote to your needs. This are the prefix that you'll be using in your iptables rules.
:msg, contains, "luifirewall:ssh trusted " /var/log/iptables/ssh_trusted.log
:msg, contains, "luifirewall:ssh illegal " /var/log/iptables/ssh_illegal.log
& ~

3. Take note of the prefix that you used above. In your iptables rules, add it in your logging rules.
$IPTABLES -A ssh-in -j LOG --log-prefix "luifirewall:ssh_trusted: "

4. Don't forget to add your log file to the lograte service. You don't want this log to eat up your space right? To do this, follow the steps below.

a. Go to the logrotate directory and create a logrotate function.
$cd /etc/logrotate.d
$nano iptables

b. Insert the following.
/var/log/iptables/*.log {
rotate 6
create 640 root adm

5. You're done! Have fun!

How to Clear Swap Space in Linux (Debian 6.0)

Last time, I posted how to clear the memory cache in linux. This time, I will post on how to clear the memory swap space.

There are very few steps.

1. Clear the swap by turning it off.
$swapoff -a
2. Turn on the swap.
$swapon -a

You can also do this is one line.
$swapoff -a && swapon -a

Friday, July 1, 2011

How to Clear Cache on Squid 3 - Debian 6.0

There are 4 steps in clearing the cache of squid3.

1. Stop squid3.
$/etc/init.d/squid3 stop

2. Delete the cache directory.
$rm -Rf /var/spool/squid3/*

3. Create swap Directories.
$squid3 -z

4. Start squid3.
/etc/init.d/squid3 start

To make it easier, you can just do it in one shot.
Here's a script that I made to do that.

#clear cache squid3 by lui 06-01-2011

/etc/init.d/squid3 stop;
sleep 1;
rm -Rf /var/spool/squid3/*;
sleep 1;
squid3 -z;
sleep 1;
/etc/init.d/squid3 start;

After clearing the cache, you can verify it by using "squidclient" to check squid cache storage.
1. Install squidclient.
$apt-get install squidclient

2. Check the cache storage capacity.
$squidclient mgr:storedir

Look for this line:
Current Capacity: 0% used, 100% free

Friday, June 17, 2011

How to Clear the Memory Cache for Debian 6.0

In Linux Server, it's normal that your RAM is growing rapidly from time to time. That's why "reboot" is the answer by most of the people from time to time. LOL!

This is how to clear the linux cache memory.

sync; echo 3 > /proc/sys/vm/drop_caches

How to install SARG on Debian 6.0

SARG is not included in the default apt sources of Debian Squeeze. To solve this problem, you need to add the "squeeze-backports" apt source in your "/etc/apt/sources.list".

1. Open your apt source file.
$nano /etc/apt/sources.list

2. Add the "squeeze-backports" at the end of the file. Add the following line and save.

deb squeeze-backports main

3. Update your system.
$apt-get update

4. Install SARG
$apt-get install sarg

5. Go to http://yourserver/sarg and enjoy SARG!

Note: You need to install Apache on your linux system for this to work. You also need to create a symbolic link if you have a different path of your web server.

ln -s /var/lib/sarg/ /srv/www/

Tuesday, June 14, 2011

How to change the hostname of your Debian 6.0 server?

1. Edit the file "/etc/hostname" and change the name to hostname that you want.


Hostname is asteriskserver1 and you want to change it to asteriskserver2

In your debian console:

$nano /etc/hostname

Change it to:

$nano /etc/hostname

2. Save the file.
3. Run "/etc/init.d/ start" to refresh the hostname of your server.
$/etc/init.d/ start

Monday, June 13, 2011

How to change timezone in Debian 6.0

1. Type the following to change your timezone.

$dpkg-reconfigure tzdata

- Choose your geographic and your city/region.


Geographic Area: Asia
City/Region: Manila

Tuesday, June 7, 2011

Linux Memory Explanation

I'm going to use the linux command "free" in our example.

$free -m

2025 is your total memory. 1425 is used and 599 is free.

The most important line here is the "-/+ buffers/cache" which determines your physical memory and "Swap".

169 used and 1856 free. Total is 2025.


"Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available."

- credits to Gary Sims on this link

Wednesday, June 1, 2011

How to check CPU and Memory Leaks on Debian 6?

1. Memory Leak Check:
#top 10 applications
$ps -A --sort -rss -o comm,pmem | head -n 11

#Check All
$ps -A --sort -rss -o comm,pmem | less

2. CPU Leak Check
#top 10 applications
$ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

#check all
$ps -eo pcpu,pid,user,args | sort -r -k1 | less

Note: In using command "less", you can exit by pressing "q".

How to install phpmyadmin on Debian 6?

1. Install phpmyadmin by apt-get.
$apt-get install phpmyadmin

2. Search for the phpmyadmin configuration directory and look for apache.conf
#Use "updatedb" to update the slocate database. We need to use "locate" to search for the file.
#Search for "apache.conf"
$locate apache.conf

3. Edit the file /etc/apache2/apache2.conf and include the phpmyadmin apache.conf.
$nano /etc/apache2/apache2.conf
# add the line below at the end of the file and save it.
Include /etc/phpmyadmin/apache.conf

4. Restart Apache2
$/etc/init.d/apache2 restart

5. Go to http://yourdomain/phpmyadmin to see if it works.

Tuesday, May 24, 2011

How to play mp3 files on asterisk for IVR?

If you are using the Background() application on your dial plan you can do this by converting your mp3 files to gsm.

1. You need to install lame and sox
apt-get install lame
apt-get install sox

2. Convert MP3 to wav and wav to gsm.
$ lame --decode example.mp3 example.wav
$ sox -V example.wav -r 8000 -c 1 example.gsm resample -ql

Example IVR Dialplan:
exten => s,1,Answer(500)
same => n(loop),Background(example&press-1&or&press-2)
same => n,WaitExten()

exten => 1,1,Playback(you-entered)
same => n,SayNumber(1)
same => n,Goto(s,loop)

exten => 2,1,Playback(you-entered)
same => n,SayNumber(2)
same => n,Goto(s,loop)

Thursday, May 5, 2011

Elastix: Email (Imap login Error)

When you install Elastix version 2.0.3 and setup the Email Server, you will encounter an error when creating an account. The error is: "IMAP Login Error".


1. Open the file "email.conf.php" from this directory /var/www/html/configs/
- nano /var/www/html/configs/email.conf.php
2. Search for the line "'HOST' => $host," and replace it with "'HOST' => 'localhost',".

Monday, March 28, 2011

What is this blog about?

Hi Everyone!

I'm making this blog to share you my knowledge in opensource specially if it's inline with asterisk. I've been on Network-Asterisk-VOIP industry for more than 4 years now. Some people call me nomad call center IT because they often see me in a different company when they meet me before!
Well, I have my own reasons of working.. I like opensource and linux that much and I have a very good interest in asterisk and networking. I used to name myself Asterguy for that fact. First five letters for asterisk.