Archive for the ‘Linux (Ubuntu)’ Category

How to check Plesk version and update the admin password

Saturday, May 14th, 2011

You can type:

rpm -q psa

or

cat /usr/local/psa/version

The password is located under:

/etc/psa/.psa.shadow

Popularity: 7% [?]

rename multiple file with same extension in Linux

Wednesday, May 11th, 2011

I want to rename all files with .txt to .sh and wildcards don’t work to well with the rm command

here’s the trick:

for file in *.txt; do mv $file `basename $file .txt`.sh; done

Popularity: 8% [?]

Serve files with no extension as PHP

Wednesday, May 11th, 2011

So I recently wget mirrored a whole website and uploaded them to my web server. The PHP files from the original server had no extension and when trying to load them, Apache did not serve them as PHP, loading a bunch of jibberish.

To solve this problem, I had to edit .htaccess :


< FilesMatch '^[^.]+$' >
ForceType application/x-httpd-php
< /FilesMatch >

#OR

#AddHandler server-parsed .php

#SetHandler application/x-httpd-php

#AddHandler application/x-httpd-php .php

#OR

#RewriteEngine On
#RewriteRule ^[^.]+$ – [T=application/x-httpd-php,L]

Popularity: 7% [?]

Offline Browsing in Linux: wget and some tricks

Wednesday, May 11th, 2011

Ever since I joined Hostgator.com, I’ve been learning a lot of Linux in the hopes that I switch my career into Linux. Hopefully Forensics related.

So this new dilemma I had was to download a website for offline browsing. I went on the hunt for an offline file browser for Linux…. I found that I could use wget to mirror a whole website.

For example, I want to make a copy of blackberrysimunlockcode.com, Here’s how:

wget -m http://blackberrysimunlockcode.com

Here the -m option is telling wget to mirror the website. This is the basic command. But say I need some advanced options. What do I do?

I was trying to get all the script files off of a website to save for later learning and all it was downloading was the index.html and robots.txt
The robots.txt file was blocking user agent wget. To confirm this I used the debug option in wget:

wget -m -d http://blackberrysimunlockcode.com

You’ll get something like:

Not following http://blackberrysimunlockcode.com/privacy.shtml because robots.txt forbids it.

or

Rejecting path sh/eg/talk.sh.txt because of rule `sh’

or

no-follow in index.html

I tried using the option –user-agent “Mozilla” ….. no luck

I tried adding the following in .wgetrc :

## Local settings (for a user to set in his $HOME/.wgetrc). It is
## *highly* undesirable to put these settings in the global file, since
## they are potentially dangerous to “normal” users.
##
## Even when setting up your own ~/.wgetrc, you should know what you
## are doing before doing so.
##

header = Accept-Language: en-us,en;q=0.5
header = Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
header = Accept-Encoding: gzip,deflate
header = Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
header = Keep-Alive: 300
user_agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
referer = http://www.google.com

…Still no luck.

The trick is to use option -e robots=off

So my new command became:

wget -m -k -e robots=off -w 2 --random-wait -U "Mozilla" -np http://blackberrysimunlockcode.com

Heres what the options do:

-m mirrors website
-k fix links so you don’t get directed to www.blackberrysimunlockcode.com/sh/eg instead of /sh/eg (relative vs absolute)
-e executes command robots=off
-w 2 sets wait time as 2 seconds so you don’t overload server and get ip blocked
–random-wait can be random in 2 secon increments
-U sets user agent
-np no parent, so if the current subdirectory/page links to parent pages, it might crawl whole website

Popularity: 8% [?]

WordPress Hosting Review

Thursday, February 3rd, 2011

Free WordPress Hosting for 3 months with Code: FREE3

They provide 1GB space and 10GB Bandwidth. Host WordPress with an easy 1-click wordpress install setup with Softaculous. They are a linux based hosting provider, most probably CentOs.The customer support is 24/7 and excellent. Check them out.

I was wondering, does an Android OS based webhosting exist? I haven’t seen one yet but it would be interesting if someone starts that. So that would be like running an AAMP server, right?

keywords: Free WordPress Host, Linux Webhosting, Shared Hosting Plan, WordPress Hosting Review, WordPress with Fantastico

Popularity: 8% [?]

FreeNX, NXserver, NeatX and more NX problems

Tuesday, April 20th, 2010

After upgrading to Lucid, I noticed I was having problems with nxserver. I couldn’t lock my screen from work anymore. I tried everything under the sun but I still kept getting the “Error: couldn’t find RGB GLX visual or fbconfig” message with glxinfo in my forwarded screen. glxinfo works fine when at the computer itself. I read that X11 forwarding has had some problems with this recently. I uninstalled nxserver and reinstalled the latest version. no luck. It made it worse and now I couldn’t even get CAPS lock to work on the remote screen. Then I found neatx. Neatx is google’s version of nxserver and which is based on nxserver. My first thoughts on neatx were that is looks the same as nxserver but a little slower. My keyboard and mouse, however, function properly but still no lock screen or screen saver. My next option: Try KDE. I installed KDE but still got the glxinfo error. Screen lock worked though! Waiting for a fix on X11 forwarding with ssh, in the mean while, I keep KDE.

Popularity: 1% [?]

How to install Kiba Dock on Karmic and Lucid

Tuesday, March 23rd, 2010

Just managed to install kiba dock on my system today. I wanted to see what the hype was all about. I followed this guide on ubuntu-forums.

make sure you have compiz running before you install kiba dock.


1. sudo apt-get remove automake1.4

2. sudo apt-get install fakeroot automake1.9 build-essential libpango1.0-dev libgtk2.0-dev libgconf2-dev libglitz-glx1-dev librsvg2-dev libglade2-dev libxcomposite-dev subversion libtool libgtop2-dev python-gtk2-dev libgnome-menu-dev libgnomeui-dev libgnomevfs2-dev intltool libxml2-dev libglitz1-dev libcairo2 libdbus-1-dev libgtop2-7 libgnomevfs2-0 libgnomeui-0 librsvg2-2 python-feedparser libasound2-dev libsdl1.2-dev libdbus-glib-1-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgstreamer0.10-0 pidgin-dev libpurple-dev

3. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/akamaru/ akamaru

4. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-dock/ kiba-dock

5. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-plugins/ kiba-plugins

6. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-dbus-plugins/ kiba-dbus-plugins

7. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-gaim-plugin kiba-gaim-plugin

8. svn co https://kibadock.svn.sourceforge.net/svnroot/kibadock/trunk/kiba-ephy-extension kiba-ephy-extension

9. cd kiba-dock

10. svn update -r 602 *

Follow this if you have 32 bit

cd akamaru/
./autogen.sh --prefix=/usr --exec-prefix=/usr
sudo make install
cd ..

cd kiba-dock/
./autogen.sh
sudo make install
cd ..

cd kiba-plugins/
./autogen.sh
sudo make install
cd ..

cd kiba-dbus-plugins/
./autogen.sh
sudo make install
cd ..

Follow this if you have 64 bit

cd akamaru/
./autogen.sh --prefix=/usr --exec-prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-dock/
./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-plugins/
CC="gcc -fPIC" ./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..

cd kiba-dbus-plugins/
./autogen.sh --prefix=/usr --libdir=/usr/lib64
sudo make install
cd ..


Now add it to the startup applications

Go to System -> Preferences -> Startup Applications and add.

Name = Kiba Dock

Command = kiba-dock

Troubleshooting:

If you are getting compilation errors, then automake is probably causing problems. You need to gedit configuration.in or configuration.ac and change all the AC_SUBST("$WHATEVER") to AC_SUBST(WHATEVER)

Popularity: 4% [?]

Getting root on your new Nexus One Android Google Phone

Tuesday, January 5th, 2010

The Nexus one was rooted before it even got released. Paul at modaco forums showed us how to perform this hack. I’ll try to simplify the method here.

1. First unlock your bootloader if you have a T-mobile Nexus One (this voids the warranty) or get an unlocked version from Google for like $550:

a. download fastboot
b. open terminal or command line and type
– Windows fastboot-windows oem unlock
– Mac ./fastboot-mac oem unlock
– Linux ./fastboot-linux oem unlock

2. Rewrite the Bootloader to obtain root privileges:

a. Download either SuperBoot or InsecureBoot and extract. (The difference is that with the insecure boot you won’t make any changes to the system and you would have to launch su manually)
b. Put the device in bootloader mode:
– Turn off the phone and restart holding the trackball.
c. Flash the bootloader:
– Windows = double click the windows bat file
– Mac = open terminal and cd to the directory containing the file. type
chmod +x install-superboot-mac.sh
./install-superboot-mac.sh

– Linux = open terminal and cd to the directory containing the file. type
chmod +x install-superboot-linux.sh
./install-superboot-linux.sh

Now you should have root!

Rooted Nexus One Google Phone
Pic courtesy of Stericson.

Popularity: 9% [?]

Automatic website backup without SSH enabled over FTP

Thursday, December 3rd, 2009

Last time I backed up my website with rsync and ssh, but on my new host they disabled SSH. Rsync does not work over ftp. I do not want to do incremental backups with delta files like is done with rdiff-backup or duplicity. I need to have an exact mirror of my site. But remember that your sql databases won’t be backed up.

Curlftpfs is the key! In this tutorial I will show you how to backup from one server to a backup location which can be your hard drive, another web host, dropbox folder, Box.net via webdav, etc.

Download curlftpfs, rsync and ncftp:
sudo apt-get install curlftpfs ncftp rsync

make directories to mount your ftp server:
sudo mkdir /media/hydtechblog
sudo mkdir /media/hydtechbackupserver

edit fstab to mount the ftp servers using curlftpfs:
sudo gedit /etc/fstab

add the lines and modify them according to your server:
curlftpfs#username:password@hydtechblog.com /media/hydtechblog fuse rw,allow_other,uid=root 0 0
curlftpfs#username:password@hydtechbackupserver /media/hydtechbackupserver fuse rw,allow_other,uid=root 0 0

One thing to remember is that these two will not mount automatically because when the computer restarts, the fstab is done while you are not connected to the network. To fix this we can just add the mount commands in our crontab.

Edit crontab:
sudo crontab -e
enter the following lines and modify accordingly:
00 09 * * * mount /media/hydtechblog
00 09 * * * mount /media/hydtechbackup
01 09 * * * rsync -avz –rsync-path=/usr/bin/rsync /media/hydtechblog/public_html /media/hydtechbackup/public_html

ctrl + o to write and ctrl + x to save

This will tell cron to mount the folders at 9:00 am and start rsync at 9:01 am. You can replace the backup location to another folder on your hard drive or your dropbox or ubuntu one folder. You can also mount box.net with webdav and use this method.

For encrypted incremental backups checkout duplicity, it also works with webdav and ftp.

Popularity: 2% [?]

Revealing Opera wand passwords on Ubuntu Linux and OS X

Monday, November 23rd, 2009

There are several utilities in Windows which reveal the opera wand password and I haven’t used windows in forever. The Opera wiki has a Power button which can help capture your password while logging in to the site. Click this link in Opera and it will install a button which you can drag to any panel. While on a page which requires a password, you can click on this new wand instead of your original wand.

Voila!

Popularity: 1% [?]