Close-up of glowing up and down arrow keys on a keyboard beside a dark terminal window full of command history

BASH - keymap and binding

Hello there folks! I have been using [BASH](http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) for quite a long time. Yet I feel like there is a lot that I don’t know. The irony is that I am doing the BASH and Linux Basics training for new hires at my firm. I am not that bad, you see. It is just that there is so much to know. And I am never happy with what I know. ...

January 26, 2014 · 3 min · 571 words · Eakan Gopalakrishnan
A monitor with several overlapping terminal windows split into panes, joined by glowing lines, with a key in front

GNU Screen - Introduction to terminal multiplexing

I thought everyone knew it. But very few actually do. Especially young software engineers. Probably everyone uses a GUI today and don’t interact much with the terminal. In fact many of the new hires at my firm have only heard of the term multiplexer, but never really bothered to use one. So I thought I’d just write a bit about it. I used to be normal putty user till 2011 (which is a shame). Then my friend introduced me to screen. At first I thought “OMG! What a mess! I would have to remember so many commands!”. But in less than a month I was a big fan of screen and had learned a lot more than necessary information about it. When you work in a company that gives you laptops as your primary workstation, your putty session dies off when you dock your laptop off or go to the next floor. So screen helped me maintain my session and made me less worried about saving work on the terminal. And it is so convenient, when I have long running tests or scripts, I just don’t bother waiting, switch to another window and keep working. ...

January 22, 2014 · 3 min · 522 words
A keyboard with a few modifier keys glowing blue, beneath a grid of floating translucent app tiles

Windows 8 and Windows 8.1 shortcuts

I was playing around with Windows 8.1 on my computer and I figured out there are some cool shortcuts maybe you haven’t known. Did you know that the icons in your task bar starting after the start button on the left bottom corner of your screen are numbered from 1 - 9. + 1 - opens the application or whatever your 1st icon after the start menu + 2 & and so on. Does the same. + ShiftKey + ...

December 23, 2013 · 1 min · 111 words
A monitor with several overlapping terminal windows split into panes, joined by glowing lines, with a key in front

DIR on VMS and display useful information

I don’t know if you have even heard of this operating system named OpenVMS by HP. Unfortunately or maybe fortunately I have had a chance to work on it. The operating system has a cool feature, file version is built into the OpenVMS file system. But the problem with this is that if you go into a log directory and list out files, the list could get really long. I was just trying to make it display things that I usually use on Linux. ls -lrt ...

August 7, 2013 · 1 min · 188 words
A monitor with several overlapping terminal windows split into panes, joined by glowing lines, with a key in front

Bash v/s Cshell - Functions and their definitions - useful 'type' keyword

Hey if you have worked on Linux then you have interacted with bash. Maybe not. But it is mostly likely that your default shell is bash. I’m not surprised. I’m among the few people on this planet who regularly interacts with cshell also. Thanks to the kind of work I do. One great feature of bash that I miss in cshell is: Functions. Surprised? Cshell doesn’t support functions. It doesn’t have any concept of function. If you wanted to simulate a function, you have to write another cshell script that does what your function would do and define an alias that calls it. ...

June 9, 2013 · 3 min · 460 words
A monitor with several overlapping terminal windows split into panes, joined by glowing lines, with a key in front

CShell and Absurd quotes and eval

I work on CSHELL these days. Probably the most unpopular shell today. Anyone would recommend not to use it. Because of the absurdness of its syntax and quoting. For an example: Top 10 reasons to avoid using CShell My intention was to write a generic wrapper script that I could use to invoke another script that supposedly attempts to update a database and in the unlikely event of failing to do so, the wrapper would wait for a while and retry again. I thought of this approach as we had been facing some database locking issues and some data that was supposed to updated wasn’t getting updated. And this was causing even more problems for us. Since some of our systems rely on this data. By the way, to give you an idea of the locking problem, let me tell you, we have one MySQL database, that is updated by several processes running on 7 different boxes. Now you can understand the number of processes trying to access the database at similar intervals. ...

June 3, 2013 · 4 min · 645 words
A keyboard with a few modifier keys glowing blue, beneath a grid of floating translucent app tiles

Windows Run box

Some cool windows hacks that I learned recently. Open the run command dialog box and type in the following short cuts to access the corresponding windows utilities. Accessibility Controls - access.cpl Accessibility Wizard - accwiz Add Hardware Wizard - hdwwiz.cpl Add/Remove Programs - appwiz.cpl Administrative Tools - control admintools Automatic Updates - wuaucpl.cpl Bluetooth Transfer Wizard - fsquirt Calculator - calc Certificate Manager - certmgr.msc Character Map - charmap Check Disk Utility - chkdsk Clipboard Viewer - clipbrd Command Prompt - cmd Component Services - dcomcnfg Computer Management - compmgmt.msc Control Panel - control Date and Time Properties - timedate.cpl DDE Shares - ddeshare Device Manager - devmgmt.msc Direct X Troubleshooter - dxdiag Disk Cleanup Utility - cleanmgr Disk Defragment - dfrg.msc Disk Management - diskmgmt.msc Disk Partition Manager - diskpart Display Properties - control desktop Display Properties - desk.cpl Dr. Watson System Troubleshooting­ Utility - drwtsn32 Driver Verifier Utility - verifier Event Viewer - eventvwr.msc Files and Settings Transfer Tool - migwiz File Signature Verification Tool - sigverif Findfast - findfast.cpl Firefox - firefox Folders Properties - control folders Fonts - control fonts Fonts Folder - fonts Free Cell Card Game - freecell Game Controllers - joy.cpl Group Policy Editor (for xp professional) - gpedit.msc Hearts Card Game - mshearts Help and Support - helpctr HyperTerminal - hypertrm Iexpress Wizard - iexpress Indexing Service - ciadv.msc Internet Connection Wizard - icwconn1 Internet Explorer - iexplore Internet Properties - inetcpl.cpl Keyboard Properties - control keyboard Local Security Settings - secpol.msc Local Users and Groups - lusrmgr.msc Logs You Out Of Windows - logoff Malicious Software Removal Tool - mrt Microsoft Chat - winchat Microsoft Movie Maker - moviemk Microsoft Paint - mspaint Microsoft Syncronization Tool - mobsync Minesweeper Game - winmine Mouse Properties - control mouse Mouse Properties - main.cpl Netmeeting - conf Network Connections - control netconnections Network Connections - ncpa.cpl Network Setup Wizard - netsetup.cpl Notepad - notepad Object Packager - packager ODBC Data Source Administrator - odbccp32.cpl On Screen Keyboard - osk Outlook Express - msimn Paint - pbrush Password Properties - password.cpl Performance Monitor - perfmon.msc Performance Monitor - perfmon Phone and Modem Options - telephon.cpl Phone Dialer - dialer Pinball Game - pinball Power Configuration - powercfg.cpl Printers and Faxes - control printers Printers Folder - printers Regional Settings - intl.cpl Registry Editor - regedit Registry Editor - regedit32 Remote Access Phonebook - rasphone Remote Desktop - mstsc Removable Storage - ntmsmgr.msc Removable Storage Operator Requests - ntmsoprq.msc Resultant Set of Policy (for xp professional) - rsop.msc Scanners and Cameras - sticpl.cpl Scheduled Tasks - control schedtasks Security Center - wscui.cpl Services - services.msc Shared Folders - fsmgmt.msc Shuts Down Windows - shutdown Sounds and Audio - mmsys.cpl Spider Solitare Card Game - spider SQL Client Configuration - cliconfg System Configuration Editor - sysedit System Configuration Utility - msconfig System Information - msinfo32 System Properties - sysdm.cpl Task Manager - taskmgr TCP Tester - tcptest Telnet Client - telnet User Account Management - nusrmgr.cpl Utility Manager - utilman Windows Address Book - wab Windows Address Book Import Utility - wabmig Windows Explorer - explorer Windows Firewall - firewall.cpl Windows Magnifier - magnify Windows Management Infrastructure - wmimgmt.msc Windows Media Player - wmplayer Windows Messenger - msmsgs Windows System Security Tool - syskey Windows Update Launches - wupdmgr Windows Version - winver Wordpad - write

May 7, 2013 · 3 min · 559 words
A monitor with several overlapping terminal windows split into panes, joined by glowing lines, with a key in front

xargs saved my day

So I was doing my regular job, writing new queries to test out my team’s new databases on Vertica. And suddenly my senior manager sends out an email to all in the team asking an estimated disk space requirement for each of our work. I had to find out how much space the raw data files for a complete history that were used to load my databases occupy on disk. ...

February 6, 2013 · 6 min · 1112 words
A close-up of a mechanical keyboard with a few modifier keys glowing purple, in front of a dark code editor

Emacs - Copy Line

To get the equivalent of kill line command in emacs for copying purposes, I use the following code snippet. Just copy paste it in your .emacs file. (defun copy-line (arg) "Copy lines (as many as prefix argument) in the kill ring" (interactive "p") (kill-ring-save (line-beginning-position) (line-beginning-position (+ 1 arg))) (message "%d line%s copied" arg (if (= 1 arg) "" "s"))) (global-set-key "\\M-k" 'copy-line) If \C is your control key then \M is your alt key. So generally by default your kill line can be done by \C-k Now you can also copy a line by doing: \M-k I don’t remember where I got this bit of code from, I lost those tabs when Firefox crashed. ...

October 2, 2012 · 1 min · 130 words