Notes by voodoo
Displaying keyword search results 1 - 6
Created by voodoo on August 14, 2011 15:42:43
Last update: August 14, 2011 15:42:43
When I ran this code snippet with strace :
f = fopen("TZ", "rb");
fseek(f, 0, SEEK_END);
...
I saw ENOTTY error with uClibc :
open("TZ", O_RDONLY|O_LARGEFILE) = 3
ioc...
With the normal gnu libc , there's no such error:
open("TZ", O_RDONLY) = 3
fstat64...
There was no error running the program. But for some reason, uClibc did a ioctl call when it opened a file, and handled it appropriately.
Created by voodoo on June 14, 2011 15:16:30
Last update: June 14, 2011 15:18:18
Count the total number of lines of shell scripts (files ending with sh ):
$ find . -type f -name \*.sh | xargs wc -l
2...
Count the total number of lines for files under the src directory:
find src -type f | xargs wc -l
Count the total number of lines for files under the current directory whose path contains src/ :
find . -type f -path \*src/\* | xargs wc -l
Created by voodoo on March 04, 2011 12:11:33
Last update: April 13, 2011 13:55:13
By default SELinux blocks execstack permission. According to Ulrich Drepper :
"As the name suggests, this error is raised if a program tries to make its stack (or parts thereof) executable with an mprotect call. This should never, ever be necessary. Stack memory is not executable on most OSes these days and this won't change. Executable stack memory is one of the biggest security problems. An execstack error might in fact be most likely raised by malicious code."
You can check if a library/application requires execstack by using the execstack utility:
execstack -q PATHTOPROGRAM
You can try to clean the flag and see if the application still runs:
execstack -c PATHTOPROGRAM
To allow execstack for cc1 :
# grep cc1 /var/log/audit/audit.log | audit2allow ...
Created by voodoo on November 24, 2010 23:21:00
Last update: March 31, 2011 08:59:05
PostgreSQL jdbc connection string: jdbc:postgresql://<hostname>:<port>/<database_name> .
Example code:
// register JDBC driver with DriverManager
Clas...
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 July 12, 2010 18:44:06
Last update: July 12, 2010 18:44:06
Use the \d command to show information about a table:
postgres=# \d patchtype
Table ...