Notes by voodoo
Displaying keyword search results 1 - 7
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 voodoo on April 13, 2011 13:47:34
Last update: April 13, 2011 13:49:20
You get "permission denied" error from Apache HTTPD for a page. And you checked file/directory permissions (the whole directory path, not just the file) and everything in httpd.conf . If everything seemed right, then SELinux may be blocking the access.
Open /var/log/httpd/error_log , you may see a line like this:
[Wed Apr 13 15:50:35 2011] [notice] SELinux poli...
These are the steps to fix:
If the directory resides in a user home directory:
# setsebool -P httpd_read_user_content 1
Create a policy package from the audit log:
# grep httpd /var/log/audit/audit.log | audit2allo...
Apply the policy package just created
# semodule -i mypol.pp
Restart apache httpd:
# apachectl restart
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 voodoo on July 30, 2010 14:53:33
Last update: July 30, 2010 14:54:52
The -d switch for cURL sends HTTP POST with data from the command line. To verify the data being posted, this is a CGI script that echos the data back:
#!C:/perl/bin/perl.exe ## ## echo -- echos ... Examples: POST data from command line: C:\>curl -d input1=value1^&input1=value2 http://lo... POST data from stdin (with @ before the - symbol): C:\>curl -d @- http://localhost/cgi-bin/echo.pl ... POST data from a file (with @ before the - symbol and input redirect): C:\tmp>cat data.txt abcd 1234 xyz ... For some reason, @ with file name didn't work as expected: C:\tmp>curl -d @data.txt http://localhost/cgi-bin/... One thing to notice is that cURL removes the new line characters when posting (thus the echo back is only one line instead of three). This can...
Created by voodoo on July 11, 2009 15:14:55
Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations.
It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com
HTTP/1.0 ...
or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...
Download openssl from openssl.org:
curl http://www.openssl.org/source/openssl-0.9.6m....
C:\>curl --help
Usage: curl [options...] <url>
...
Created by voodoo on June 17, 2010 15:23:02
Last update: June 17, 2010 15:35:40
Use useradd to add a user (the switches are not required, but it's a good idea to give them. For example, without -m you'd create a user without a home directory):
# -d switch specifies user home directory
# -m ...
You also need to use the passwd command to set a new password before the user can log in.
To delete a user, use the userdel command:
userdel demo
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...