yank a whole file in #vim with :%y+ via @stackalert http://bit.ly/mT8G3A
I use the following instruction: :%y+
I use the following instruction: :%y+
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
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
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
- 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)
UNIX / Linux: Deleting Multiple Files In Bulk
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" -deleteOR
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 {} \;
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).
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:
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.
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"
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.
And there you go.
Search for text in vi or vim
Contributed by Rex
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