add a small password generator to your .bashrc http://bit.ly/ZYnTu #linux

Here is a sample random password generator (put in your ~/.bashrc):

genpasswd() {
        local l=$1
               [ "$l" == "" ] && l=20
              tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}

Run it:
genpasswd 16
Output:

uw8CnDVMwC6vOKgW

ssh server security enhancements via NixCraft

Posted

edit two files on the #linux #cli with vim -o foo.rc bar.rc http://bit.ly/oTW60l via @nixcraft

Open two windows

Start vim as follows to open two windows,split horizontally:
$ vim -o /etc/passwd /etc/hosts
OR
$ vim -o file1.txt resume.txt

Posted

yank N lines in #vim with Nyy http://bit.ly/VFFUK

Cutting and Pasting Text

The following commands allow you to copy and paste text.

  yy copy (yank, cut) the current line into the buffer
  Nyy or yNy copy (yank, cut) the next N lines, including the current line, into the buffer
  p put (paste) the line(s) in the buffer into the text after the current line

Posted

start dosbox in fullscreen mode by setting fullscreen = true in dosbox.conf http://is.gd/aK2kNC

fullscreen = true | false
Start DOSBox directly in fullscreen.
Default is false.
(since 0.??)
fulldouble = true | false
Use double buffering in fullscreen. See [1]
Default is false.
(since 0.??)
fullresolution = width x height | original | desktop
Scale the application to this size IF the output device supports hardware scaling (i.e. any output other than surface). Original is the game's default or chosen (through setup.exe or in-game menu) resolution. If original resolution is less than desktop resolution, DOSBox will switch the screen resolution to the closest match requested by the game or application. For example, if a game in DOSBox is requesting a graphics screen resolution of (320 x 240) while your desktop is (1920 x 1200), DosBox will switch to (320x240) or the next highest resolution supported by your GPU drivers, e.g. (800 x 600) if the former is not available. Many games will be below the minimum resolution supported by modern video cards, so DosBox will scale the game up to at least that minimum. Note: the scaler setting under [render] is also able to scale up the original resolution to some degree. Those changes are performed before any additional scaling done with fullresolution setting.
Default is original.
(since 0.62)

Posted

delete bulk files in #linux with find /path/to/delete -type f -iname "fileType" -delete http://is.gd/R7umqA

UNIX / Linux: Deleting Multiple Files In Bulk

by Vivek Gite on November 18, 2010 · 0 comments

How do delete multiple files in bulk (say all *.bak file stored in /netapp/ and its subdirectory) under Linux / UNIX operating systems?

You can use the find command as follows to find and delete file in bulk:

 
find /path/to/delete -type f -iname "fileType" -delete
 

OR

 
find /path/to/delete -type f -iname "fileType" -exec rm -f {} \;
 

To delete all *.bak files in bulk from /netapp/ and its subdirectory, enter:
# find /netapp/ -type f -iname "*.bak" -delete
OR
# find /netapp/ -type f -iname "*.bak" -exec rm -f {} \;

Posted

ctrl+f10 in #dosbox to release mouse control http://is.gd/ZgbVUG

From the manual page (please check manual pages before posting questions):
Code:
SPECIAL KEYS
       ALT-ENTER   Go full screen and back.
       ALT-PAUSE   Pause emulation.
       CTRL-F1     Start the keymapper.
       CTRL-ALT-F5 Start/Stop creating a movie of the screen.
       CTRL-F4     Swap mounted disk-image (Only used with imgmount). Update directory cache for all drives!
       CTRL-F5     Save a screenshot.(png)
       CTRL-F6     Start/Stop recording sound output to a wave file.
       CTRL-ALT-F7 Start/Stop recording of OPL commands.
       CTRL-ALT-F8 Start/Stop the recording of raw MIDI commands.
       CTRL-F7     Decrease frameskip.
       CTRL-F8     Increase frameskip.
       CTRL-F9     Kill dosbox.
       CTRL-F10    Capture/Release the mouse.
       CTRL-F11    Slow down emulation (Increase dosbox Cycles).
       CTRL-F12    Speed up emulation (Decrease dosbox Cycles).
       ALT-F12     Unlock speed (turbo button).

Posted

use windows key to open “start” menu in #ubuntu #linux #HowToGeek http://is.gd/6va7q9

Use the Windows Key for the “Start” Menu in Ubuntu Linux 10.04+

Linux distributions like Ubuntu open the main menu with Alt+F1 instead of the Windows key that most new Linux users would be expecting, but it used to be simple to change the shortcut key. Since Ubuntu 9.10 the process isn’t so obvious, but we’ve got the instructions for you.

Just in case you’re a total newb, here’s the menu we’re talking about:

image

Change the Gnome Main Menu Shortcut Key to the Windows Key

The first thing you’d normally do is head to System –> Preferences –> Keyboard Shortcuts to change out the shortcut key, but sadly the “Show the panel’s main menu” can’t be assign to the Windows key. You can hit the key as much as you want, but it won’t work here.

image

What you’re going to need to do is either open up a terminal or use the Alt+F2 shortcut key to bring up the Run Application dialog, and then paste in the following:

gconftool-2 --set /apps/metacity/global_keybindings/panel_main_menu --type string "Super_L"

image

Once you’ve hit the enter key, the Windows key will not only open the main menu, but the Keyboard Shortcuts panel will be updated with “Super L”, which means the left Windows key.

image

And there you go.

Posted

/foo [Ret] to search for string 'foo' in #vim http://is.gd/2jOm29

Search for text in vi or vim

Contributor Icon Contributed by Rex Date Icon November 10, 2003  

 

vi and vim have powerful searching capabilities because they bring to bear the richness of regular expressions.


To search for the next occurence of the text ‘maybe’ from the current cursor position, type:

/maybe

Search backward from the current position by using ? instead of / in the command.

Once you have searched for something, you can find the next occurrence by pressing n or the previous occurrence with N.

Searching in vi/vim is enhanced with regular expressions. For example, to find the next occurence of the text ‘Total’ that occurs at the beginning of a line, use:

/^Total

Posted