Gunzip

This is how to extract a .tar.gz file using Gunzip:

gunzip -c /path/to/folder/filename.tar.gz

To view a list of files in an archive use:

gunzip -c /path/to/folder/filename.tar.gz | tar -tvf -

To extract a single file use:

gunzip -c /path/to/folder/filename.tar.gz | tar -xvf – path/within archive/filename.php

how to get the contents of another file with php

There are many times when you may need to get the contents of another file on a server with php. Rather it is XML, html, or an RSS feed this is how to do it. The best way of doing this is to use this:

function fetch_content($url) {

$crl = curl_init();

$timeout = 5;

curl_setopt ($crl, CURLOPT_URL, $url);

curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);

curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);

$ret = curl_exec($crl);

curl_close($crl);

return $ret;

}

You should now have the content of the $url stored in a string calue. Note that this will not fetch any supporting files such as CSS of javascript. You will have to further parse these files to store their contents into a seperate string value.

how to install php5 and apache on Ubuntu

To install PHP5 and apache on an ubuntu simply type the follwoing into the shell command line:

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

Your web files can now be found in /var/www

that’s all there is to it!

how to speed up firefox

This tutorial will tell you a few tips to tweak Firefox and make it run even faster! First off you need to type in the address about:config and hit go.

about_config

You Will be confronted with a warning. Hit the button that says that you will be careful.

carefulNow in the filter box type in network.http.pipelining and double click it until it ssa true

network.http.pipelineing

Do the same for network.http.pipelining.maxrequests

network.http.pipelineing.maxrequests

Now change network.http.proxy.pipelining to true

network.http.proxy.pipelining

Next change network.dns.disableIPv6 to true

network.dns.disableIPv6

Now create a new integer by right clicking and going to new->integer

new_integer

Name this integer nglayout.initialpaint.delay

nglayout.initialpaint.delay

Set its value to 0

nglayout.initialpaint.delay_0

This should make your firefox 3-30 time faster!

Install a drop down konsole in Ubutnu

Tilda is a konsole that drops down from the top of ubuntu withh just the press of a key. To install it simply type the following into a konsole window:

sudo apt-get install tilda


quickly restart the gnome interface in ubuntu

If you want to quickyly restart the X windows utility in Ubuntu the easiest way is to use the following key combination on your keyboard:

Ctrl+Alt+Backspace

Add “Open with gedit” to the right click menu in Ubuntu

The file browser in Ubuntu provides the ability to run scripts on a selected file. These scripts can be used to do anything from opening a file to zipping or uploading, or anything that you can do from the command line.

To start this off open up a terminal window and type in:

gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit

Just copy and paste in this script found on the G Scripts site.

#!/bin/bash
#
# Nautilus script -> open gedit
#
# Owner : Largey Patrick from Switzerland
#     patrick.largey@nazeman.org
# www.nazeman.org
#
# Licence : GNU GPL
#
# Copyright (C) Nazeman
#
# Ver. 0.9-1 Date: 16.02.2002
# Add multiple file open in the same windows
#
# Ver: 0.9  Date: 27.10.2001
# Initial release
#
# Dependence : Nautilus (of course)
#   Gnome-utils (gdialog)
#
filesall=””
while [ $# -gt 0 ]
do
files=`echo “$1″ | sed ’s/ /\?/g’`
filesall=”$files $filesall”
shift
done
gedit $filesall&

Save and close that Gedit window and execute this command to make the file executeable:

chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit

This should be the result when you right click a file:

How to quickly block an IP address

If you are looking for a way to quickly and easily block an IP from connecting to your server using the IPtables firewall then just use this script.

First off you need to make yourself root. Then you type in:

vi /usr/local/bin/blockip

Then just paste in this code:

#!/bin/sh

if [ "$1" != "" ]; then

/sbin/iptables -I INPUT -s $1 -j DROP

else

echo “Type an IP”

echo “Usage:”

echo ” Blockip <ipaddress>”

echo “”

fi

After you get that done you need to make the file executable, so just run this command:

chmod u+x /usr/local/bin/blockip

Now all you need to do to block an ip is type in the command like this (remember to change the IP to the one that you want to block) :

blcokip 20.2.2.20

That’s all there is to it! If you encounter any problems with this script please let me know, but I tested it and it should work.


What is svchost.exe?

The chances are that you are reading this because you are wondering what in the world svchost.exe is and why it is running on your system.

What Is It?

Microsoft’s explanation for what svchost.exe is is:

svchost.exe is a generic host process name for services that run from dynamic-link libraries

So what does this mean in human speak you may ask? Awhile back Microsoft decided to start moving its internal Windows services into .dll files instead of .exe files. This is how svchost.exe came to be. This is why if you ever take a look at your running processes you will notice that there are many svchost.exe instances running. This is because if all of the processes ran under just one instance all of Windows could be brought down by one failure. This is why they are spread out amongst many different processes.

What can I do about this?

You may ask how you can trim this list of svchost.exe processes down to size. well, for starters you can disable process that you don’t absolutely need running. Also if one of the process seems to be taking an extensive amount of CPU cycles you can always try restarting the process. The hardest part is finding out what process is controlled by what svchost.exe instance. To check go to command prompt  and type:

tasklist /SVC

The only problem with using this method is that some of these names can be a little bit cryptic and hard to figure out. Another option is to right click on the process in the task manager and choose the “Go to service(s)” Option. This will cause all of the processes running under that svchost.exe to be highlighted.

Disabling Services

Go to the administrative tools tab in the control panel and open up services or simply type services.msc into run.

Find the process that you want to disable and just double click it.

I hope that this can be of help to somebody!

Follow

Get every new post delivered to your Inbox.