For Poderosa/Putty
– Create or edit the ~/.inputrc file with the following code:
"\e[3~": delete-char
For SecureCRT
Click Tools Keymap Editor Click the "DEL" button Click Map Selected Key enter in "\e[3~" (no quotes) Hit OK Save
For Poderosa/Putty
– Create or edit the ~/.inputrc file with the following code:
"\e[3~": delete-char
For SecureCRT
Click Tools Keymap Editor Click the "DEL" button Click Map Selected Key enter in "\e[3~" (no quotes) Hit OK Save
I really hate that the delete key backspaces. I’m sure there is a lot of pointless posturing on how this is the ‘old school’ way. Well… 1) I don’t care 2) I’m new school and I want a backspace key AND a delete key…
Add the following line to your ~/.emacs file:
(global-set-key (kbd "") 'delete-char)
Every once in a awhile you may find you need to run a command as a different user than yourself. In order to do so you will first need to be root, then perform the following:
su <username> -c '<command1>; <command2>;'
Eventually in scripting you are likely to want to output to both the screen (standard out) and to a file. This makes it convenient to see whats getting “logged” without needing the extra step of cat’ing the file.
For example:
ls -al | tee ls_al_result.txt
This will give you your normal ‘ls -al’ results but also feed them to your new file.
Tail multiple files at once:
tail -f log1.log log2.log
If you want to highlight something when doing ‘tail -f’ you can use the following command:
tail -f /var/log/logfile | perl -p -e 's/(SEARCH)/33[7;1m$133[0m/g;'
Or if your terminal supports colours, such as linux terminal, you can use this:
tail -f /var/log/logfile | perl -p -e 's/(SEARCH)/33[46;1m$133[0m/g;'
And if you want it to beep (annoy you!) on a match use this:
tail -f /var/log/logfile | perl -p -e 's/(SEARCH)/33[46;1m$133[0m07/g;'
Another option using sed instead:
tail -f /var/log/logfile | sed "s/(SEARCH)/^[[46;1m1^[[0m/g"
Note that in the last example you have to actually type “cntl-v cntl-[” in place of “^[”
For a full list of control characters on Linux see:
man console_codes
This is the MOD for the much requested “Allow user to select department”…
Open $TICKETS_HOME/open.php
Remove
$_POST['deptId']=
(only this, not the rest of the line)
Open $TICKETS_HOME/include/client/open.inc.php
Before the Subject
insert the following:
<td align="left"><b>Department:</b></td> <td> <select name="deptId"> <option value="" selected >Select Department</option> <? $services= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE.' ORDER BY dept_name'); while (list($deptId,$dept) = db_fetch_row($services)){ $selected = ($info['deptId']==$deptId)?'selected':''; ?> <option value="<?=$deptId?>"<?=$selected?>><?=$dept?></option> <? }?> </select> <font class="error"><b>*</b> <?=$errors['deptId']?></font> </td> </tr>
Recently I replaced an old .cgi file with a shiny new .php page. I realize everyone is still linking to the old .cgi file so I had need to forward them all onto the sexy new page. This can be accomplished as easily as the following:
Simply replace (after backing up) your .cgi file with the following contents
#!/path/to/perl print "Location: http://domain.com/newpage.php\n\n";
Sometimes we have so much javascript code in our files that it just becomes bulky and gets in the way. Instead of including it all in your file, save it all to a seperate file that can be referenced in your page (or better yet multiple pages).
Simply place the following within your <head> tags:
<script language="javascript" src="/path/to/file.js"></script>
Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?
PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.
Thank you!
- The Management
Sudo Bash
By Geeks - For Geeks