Recent Notes
Displaying keyword search results 1 - 10
Created by voodoo on June 21, 2011 08:19:33
Last update: June 21, 2011 08:34:28
Got "base64: invalid input" error:
$ base64 -d base64_encoded.txt >original.bin
ba...
which can be easily dismissed as "input is invalid base64 encoded" or "partial input". But I know it's valid base64 encoded input!
The problem was, the input was base64 encoded on Windows! The error goes away after converting to Unix format with dos2unix .
dos2unix < base64_encoded.txt | base64 -d >origina...
Version of base64 used:
$ base64 --version
base64 (GNU coreutils) 8.5
...
Created by woolf on February 10, 2011 12:51:14
Last update: February 10, 2011 13:06:11
Windows command line shell does not come with a sleep command. One trick is to emulate sleep using the ping command:
C:\>ping /?
Usage: ping [-t] [-a] [-n count...
To sleep for about 5 seconds:
@rem make sure to ping a non-existing IP, otherwis...
If you have the Windows Resource Kit installed, it does provide a sleep command:
C:\>sleep
Usage: sleep time-to-sleep-in-s...
Created by voodoo on November 02, 2010 16:07:49
Last update: November 02, 2010 16:11:56
From the command line I can start and stop Windows services with NET START service_name and NET STOP service_name . But the NET command does not give a way to find the service name. You need the sc command to get the service name, below are some examples:
List all running services:
sc query
List all services, running or not running (notice the space after =):
sc query type= service state= all
List all active drivers:
sc query type= driver
Find information about the "Indexing Service" (requires GNU grep):
sc query type= service state= all | grep -i index ...
Start the indexing service:
sc start CiSvc
Stop the indexing service:
sc stop CiSvc
Check the status of the indexing service:
sc query CiSvc
Created by woolf on October 22, 2010 02:53:32
Last update: October 22, 2010 03:18:12
The easiest way to shutdown Windows XP with a shortcut is to create a shortcut icon on the desktop (or the Start menu, or the Quick Launch menu) and assign a shortcut key combination.
Useful command line commands:
Shutdown : shutdown -s -t 0
Restart : shutdown -r -t 0
Log off : shutdown -l -t 0
Hibernate : rundll32.exe PowrProf.dll, SetSuspendState Hibernate
Command line options for shutdown :
C:\> shutdown /?
Usage: shutdown [-i | -l | -s ...
Created by nogeek on August 08, 2010 23:38:04
Last update: August 08, 2010 23:38:04
Especially, the ethernet0.virtualDev = "e1000" line should be absent in order for networking to work.
#!/usr/bin/vmplayer
# Filename: Win2000.vmx...
Created by Dr. Xi on June 11, 2010 19:04:18
Last update: June 11, 2010 19:06:35
The caret ^ is DOS command line escape character.
Example 1: echo < and > as is, not interpreting them as input/output redirect.
@rem sign an XML file. Requires Java class utils.x...
Example 2: treat & literally, not as the special character to combine two commands.
@rem search "dos command line" in Google.
curl ...
Add switch -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" to make curl look like Firefox.
Created by voodoo on February 07, 2010 04:59:36
Last update: February 07, 2010 05:01:41
From X(7) manual page : Although the layout of windows on a display is controlled by the window manager that the user is running (described below), most X programs accept a command line argument of the form -geometry WIDTHxHEIGHT+XOFF+YOFF (where WIDTH, HEIGHT, XOFF, and YOFF are numbers) for specifying a preferred size and location for this application's main window. The WIDTH and HEIGHT parts of the geometry specification are usually measured in either pixels or characters , depending on the application. The XOFF and YOFF parts are measured in pixels and are used to specify the distance of the window from the left or right and top and bottom edges of the screen, respectively. Both types of offsets are measured from the indicated edge of...
Created by Dr. Xi on November 19, 2008 00:22:27
Last update: January 07, 2010 23:00:36
There is a open source project named [ini4j] for processing Windows .ini configuration files. However, I found it an overkill for my purposes. So here is my simple implementation of a .ini parser. It mimics the standard java.util.Properties class with enhancements to get and set properties by section name. There are only a few simple rules: Leading and trailing spaces are trimmed from section names, property names and property values. Section names are enclosed between [ and ] . Properties following a section header belong to that section Properties defined before the appearance of any section headers are considered global properties and should be set and get with no section names. You can use either equal sign ( = ) or colon ( : )...
Created by Dr. Xi on December 05, 2009 20:12:16
Last update: December 05, 2009 20:46:45
It's quite easy for Perl to open a pipe and read from it:
$file = "nospace.txt";
open(IN, "cat $file |") ...
But the code breaks when the file name contains a space:
# This does not work!
$file = "yes space.txt";
...
On Windows, these don't work either:
# This does not work!
$file = "yes space.txt";
...
You need to use a technique called Safe Pipe Opens :
$file = "yes space.txt";
$prog = "cat";
...
Created by Dr. Xi on September 09, 2008 23:13:27
Last update: March 09, 2009 15:48:47
Oracle provides two versions of SQLPlus: a command line version ( sqlplus.exe ) and a windows version ( sqlplusw.exe ). The windows version is rather primitive (ever used Windows 3.1?), but it moved many commands/options to the menus. So it may still be easier to get started with it then the command line version. However, you may be better off with the command line version after you get somewhat familiar with SQLPlus. In SQL*Plus you can enter: SQL*Plus commands. For a list of commands enter help index at the SQL prompt SQL commands - SQL statements sent to the database. These statements are terminated by semicolon unless you change it PL/SQL blocks - Blocks of PL/SQL code. When you enter a SQL command or PL/SQL...