Monday, July 23, 2012

bash fc - fix command cheatsheet

bash's BUILTIN fc command (fix command) is very useful and generally under-utilised. Here is a quick cheatsheet of some common fc commands which can be very useful indeed.

Personally it was hard to recall and decrypt the man bash fc section, so I wrote up a little cheatsheet for future reference, as follows.
$ fc -l 5680 5690
This will echo the commands in the shell history from 5680 5690. No execution.
$ fc -l -5 (minus the letter L and minus the number one)
This will echo the last 5 commands in the shell history, the same as history 5. No execution.

CAREFUL! The following commands require care, so that you don't inadvertently execute commands on your system! Please read how they work and how to handle them before trying them for yourself!
$ fc 5699 (careful!)
This opens the editor stored in FCEDIT, falling back on EDITOR. If neither env var is set, vi is used.
The editor will be populated with history line 5699 in this example.
When editing is complete, the commands are echoed and executed!
If you don't want to execute anything, ensure the file is empty and save and exit.
$ fc 5680 5690 (careful!)
Same as above but the editor will contain the commands within the shell history range.
If you don't want to execute anything, ensure the file is empty and save and exit.
$ fc -10 -1 (careful!)
Same as above but the editor will contain the last 10 commands in the shell history.
If you don't want to execute anything, ensure the file is empty and save and exit.
$ fc -s number|command (careful!)
Where number matches a shell history number OR command will match the the most recent shell history command that begins with command, then execute the command.
$ fc -s match=replacement number|command (careful!)
Same as above and each instance of match is replaced by replacement, then execute the command.

Feel free to checkout man bash to learn more in depth about this command including some options I didn't cover here.

Sunday, July 22, 2012

ffmpeg and x264 under cygwin

x264

$ ./configure --enable-shared
$ make && make install && make install-lib-shared && make install-lib-dev

ffmpeg

$ ./configure --enable-gpl --enable-libx264 --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib" --enable-static --disable-shared
$ make && make install

Monday, May 7, 2012

GTAIV command line arguments

One can use the commandline.txt with ths single line -help to get a pop up with the list of available options for launching GTAIV. I used SnagIt to capture the pop ups output.

This output is from GTAIV steam version 1.0.7.0 (the latest version as of writing).

LaunchGTAIV.exe [options] Where [options] are one or more of: ==== [ Global ] ==== -adapter: Use the specified screen adapter number ?zero-based? -disableimposters: Turn of the imposter rendering for vehicles -noBlockOnLostFocus: Don't block the window update when it loses focus. ==== [AUDIO] ==== -fullspecaudio: Force high-end CPU audio footprint -minspecaudio: Force low-end CPU audio footprint ==== [GLOBAL] ==== -benchmark: Determines if we run the benchmark immediately -safemode: Sets graphics setting to lowest setting ==== [GRAPHICS] ==== -forcehighqualitymirrors: Enable 64 bit mirrors -forcer2vb: force r2vb -frameLimit: number of frames to limit game to -framelockinwindow: Force framelock to work even in a window ?works best with 60Hz monitor refresh? -fullscreen: Force fullscreen mode -gpucount: Lets you manually set the GPU count if query fails -height: Set height of main render window ?default is 480? -managed: Use D3D runtime managed resources -nominimize: Disables the ability to restore the game from minimize and changing resolutions - Reduces System Memory Footprint -norestrictions: Do not limit graphics settings -noswapdelay: Disable sleep delay before Present ?disable fix for hard Present stalls? -novblank: Disable wait for vblank -refreshrate: Set refresh rate of main render window -stereo: Set game to support stereo rendering mode -unmanaged: Use application managed resources -width: Set width of main render window ?default is 640? -windowed: Force windowed mode ==== [INPUT] ==== -usedirectinput: Allow DirectInput alongside XInput support. ==== [MEMORY] ==== -availablevidmem: Percentage of available video memory -memrestrict: Set the restriction the amount of available memory for managed resources -no_3GB: Disable 32bit OS with /3GB -nomemrestrict: Do not restrict the amount of available memory for managed resources -noprecache: Do not precache resources -percentvidmem: Percentage of video memory to make available to GTA -reserve: Amount of memory to set aside for other applications -reservedApp: Amount of memory to leave available within application space ==== [QUALITY SETTINGS] ==== -autoconfig: Automatically adjust quality setting to maintain desired frame rate ?15-120? -detailquality: Set detail distance ?0-99? -renderquality: Set anisotropic filtering ?0-4? -shadowdensity: Set the number of lights that cast shadows -shadowquality: Set the shadow quality ?0-4? -texturequality: Set texture quality ?0-2? -viewdistance: Set LOD view distance ?0-99? ==== [TIME] ==== -notimefix: Disable Time Fix
Props to:
mkey82 @ GTA Forums for publishing some great related info

Tuesday, April 24, 2012