mount | column -t
Tag: World
-
Simple http server
python -m SimpleHTTPServer
-
Run the last command as root
sudo !!
-
Find the top 10 largest directories
$ find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {} | sort -rn
-
Kill a broken ssh connection.
$ ~.
This is useful for example if you are on ssh in a server and the server goes down without letting you out.This is part of a larget sets of escape sequences provided by ssh. You can find them with ~? Here’s the list:
~. – terminate connection (and any multiplexed sessions)
~B – send a BREAK to the remote system
~C – open a command line
~R – request rekey
~V/v – decrease/increase verbosity (LogLevel)
~^Z – suspend ssh
~# – list forwarded connections
~& – background ssh (when waiting for connections to terminate)
~? – this message
~~ – send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
View this command to comment, vote or add to favourites
View all commands by carlessoby David Winterbottom (codeinthehole.com)
-
Find the population of the world
$ curl –silent http://www.census.gov/population/international/ | grep wclocknum | sed -r ‘s#^.*>([0-9,]+)<.*$#\1#'
-
Show directory tree
$ find . -type d | sed -e “s/[^-][^\/]*\// |/g” -e “s/|\([^ ]\)/|-\1/”
-
Psgrepp
$ ps aux | grep $(echo $1 | sed “s/^\(.\)/[\1]/g”)
-
20char long alphanumeric password
$ head -c20 /dev/urandom | xxd -ps
-
My devel setup on my laptop.
Since, i cannot afford to have an additional H/W setup, i thought of creating my own setup on a virtual environment.
I tried Virtualbox for setting up my virtual env, Because I am more comfortable on it. Download the VirtualBox setup from the virtual box site. Download you favorite Linux/Windows distribution and setup a virtual machine with that. Now, comes the most trickiest part, I really don’t like running multiple windows on my desktop, and unnecessary clutter the way it looks. Moreover, going through the tab becomes slight painful, so, I decided to go headless(of course running it headless).You can run this command to run your virtual machine, without even bother to open your virtualbox application, and can modify your system startup to run it on every boot and shut it down whenever your sytsem is shutting down.
[code language=”bash”]vvboxmanage startvm "DEVELHOST" –type headless # Here Devlehost is my virtualbox name.[/code]
-
Saving your work with github.
Just managed to get my hands on github, have created my repository long back, but hadn’t got time to push anything to it. Couple of days back, must give it a try and here I am, tried, worked and got answers for some of my weired questions, writing it so, it can help me later when redoing it and so to others who may face similar challenges.
-
Solaris Containers
Solaris Containers
There are two types of zones global and non-global. The global zone is the server itself and is used as the system-wide configuration and control, there can only be one global zone per system. A maximum of 8192 non-global zones can exist on a system, all non-global zones are isolated from each other.
There are two type types of non-global zones sparse root zone or whole root zones.
-
emacs todo mode
This tutorial has been posted by Logan Lee on the Usenet (http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/6d55768f621067c6/cec507b4c628b776?pli=1):
(1) To enter todo major mode, M-x todo-mode. (2) Let's jump to the default Todo category. Press 'j' then select 'Todo'. (3) Let's insert a dummy task. Press 'i' then enter description then category that it belongs to. In this case, there is only one category (ie. Todo) so enter 'Todo' as its category. (4) Let's insert another dummy task in order to demonstrate raising or lowering priority of a task or filing a task once it's done. Do this by pressing 'i' again and following the rest of step 3. (5) Now, try pressing 'r' to move the task at cursor up by one line or 'l' to lower it by one line. The line position of a task represents its respective priority. (6) Now, try pressing 'f' at a task to file it. Filing a task means you add it to a file called '.todo-done' located at your home directory. You will see on your screen that the filed task has disappeared from view. (7) Lastly, let's try adding a new category. 'M-x todo-add-category'. First, you will be directed to the source of '.todo-do' file. Don't panic because of unknown syntax shown to your screen. Proceed to step 8 to learn more about the syntax of .todo-do file. (8) The format of .todo-do file: ;; This specifies that "Todo" and "New Category That You Have Added" are ;;+categories of todo-mode. -*- mode: todo; todo-categories: ("Todo","New Category That You Have Added"); -*- */* --------------------------------------------------------------------------- ;; Lists tasks under Todo */* --- Todo */* 2007-01-02 19:12 Dummy Task2 ;; These are dummy tasks from steps 3,4. */* 2007-01-02 19 11 Dummy Task1 ;;+Task2 is higher priority than Task1. --- End ;; Lists tasks under New Category That You Have Added */* --- New Category That You Have Added ;; As you can see there are no tasks belonging to "New Category That You Have Added" ;) --- End (9) There are other commands and associated abbreviations which can be found in Todo item at menu bar. -
Setting up cgi in userdir
enable a CGI directory for every user in apache.
Configure apache for userdir.
[code language=”bash”]
a2enmod userdir
[/code]
open the userdir.conf file and add the following
[code language=”text”]
<Directory /home/*/public_html/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>
[/code] -
Setting up networking in Debian
Networking in Debian GNU/Linux
Configure interface in /etc/network/interfaces
[code language=”text”]
iface eth0 inet static
address <ip address>
netmask <netmask>
[/code] -
Working from ipad
This is awesome
-
Resetting the Root Password for mysqld on Unix Systems
“These are taken from the mysql website and is for refrence and documentation purpose”
On Unix, use the following procedure to reset the password for all MySQL
rootaccounts. The instructions assume that you will start the server so that it runs using the Unix login account that you normally use for running the server. For example, if you run the server using themysqllogin account, you should log in asmysqlbefore using the instructions. Alternatively, you can log in asroot, but in this case you must start mysqld with the--user=mysqloption. If you start the server asrootwithout using--user=mysql, the server may createroot-owned files in the data directory, such as log files, and these may cause permission-related problems for future server startups. If that happens, you will need to either change the ownership of the files tomysqlor remove them. (more…) -
Adding routes in AIX
Configuring a gateway in AIX
To configure a machine to act as a gateway, use these instructions.
For clarity, this procedure assumes that the gateway machine
connects two networks, and that the gateway machine has already been minimally
configured on one of the networks. -
AIX commands you should not leave home without
How would I know if I am running a 32-bit kernel or 64-bit kernel?
To display if the kernel is 32-bit enabled or 64-bit enabled, type:
bootinfo -K