Notes by voodoo
Displaying keyword search results 1 - 10
Created by voodoo on December 08, 2011 08:52:40
Last update: December 08, 2011 08:52:40
I don't know if there's a fool proof way to find out which Linux distro you are running on, but here are some ways you can try:
cat /proc/version
cat /etc/issue
cat /etc/*release
lsb_release -a
Results on Ubuntu 11.10 oneiric:
$ cat /proc/version
Linux version 3.0.0-13-gene...
Results on Red Hat Enterprise Server:
$ cat /proc/version
Linux version 2.6.18-128.1....
Created by voodoo on September 04, 2011 14:23:17
Last update: September 04, 2011 14:25:05
I just installed Ubuntu 11.04 desktop on my old Dell laptop, but the cdrom is not auto-mounting. Normally this simply works.
I tried various things like adding cdrom to /etc/fstab and installing halevt (which failed), none worked. However, I found out that despite talks of using gnome-volume-manager etc, at least for this version of Ubuntu automount is managed by Nautilus (file manager): start gconf-editor and navigate to /apps/nautilus/preferences/ , media_automount should be checked (but it's checked by default, unless you changed it).
In the end, I wasn't able to make cdrom automount, although USB drives automounted fine. Instead of wasting more time to diagnose the problem, I manually mounted the cdrom drive:
$ sudo mount /dev/cdrom /cdrom
Created by voodoo on August 30, 2011 12:30:59
Last update: August 30, 2011 12:32:33
Summarized from The C Book : There are essentially two types of object in C: the internal and external objects. Anything declared outside a function is external; anything inside one, including its formal parameters, is internal. Since no function can be defined inside another, functions are always external. All function declarations implicitly have the extern keyword stuck in front of them, whether or not you put it there. These two declaearions are equivalent:
void some_function(void); extern void some_func... The term linkage is used to describe the accessibility of objects from one file to another. There are three types of linkage: external , internal , and no linkage . Type of linkage Type of object Accessibility external external Across files, througout the program internal external Within...
Created by voodoo on August 27, 2011 19:17:10
Last update: August 27, 2011 19:17:10
The CPAN module Net::Socket::NonBlock has a port forwarding utility which works for both Unix and Windows:
$ perl tcpudppf.pl
Usage: tcpudppf.pl <LocalAdd...
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 March 24, 2011 09:55:43
Last update: March 24, 2011 10:04:02
Goto http://www.adobe.com/downloads/ , click the download flash player icon
Select YUM for Linux from "Select version to download" dropdown
Save the rpm file, which is about 4.3K.
Install the RPM:
rpm -i adobe-release-i386-1.0-1.noarch.rpm
Import the Adobe key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-li...
Install the flash plugin
yum install flash-plugin nspluginwrapper.x86_64 ns...
Created by voodoo on March 23, 2011 15:32:55
Last update: March 23, 2011 15:36:00
I got "Unknown SSL protocol error" when using curl to get the default page from iis 7 (of course, IE simply displayed "Internet Explorer cannot display the webpage"). The problem was that I used the default iis 7 certificate, which didn't have a name - and that caused SSL to fail. I created a new certificate with a name and that fixed the problem.
# curl -v -k --dump-header - https://192.168.80.15...
Other possible reasons:
3 Common Causes of Unknown SSL Protocol Errors with cURL
Created by voodoo on March 09, 2011 16:42:19
Last update: March 10, 2011 08:41:31
Email attachment blocking is a safety measure that can be a real pain in the *&^ when you have a legitimate need to send some file types that are considered "dangerous". Fortunately, as developers we have more than one weapon in our arsenal to defeat that feature. Here are some options I tried. Put the offending file in a zip - doesn't work for some services, Gmail is an example. Change file extension, e.g., from .exe to .ex_ or .doc. But this does not work if you are sending a WAR (Wab Application Archive) that contains hundreds of .js files. Base64 encode the zip, then gzip it. To restore:
cat received.gz | gzip -d - | base64 -d - >origina... This may still fail for...
Created by voodoo on February 02, 2011 14:28:52
Last update: February 02, 2011 14:30:27
The ProxyRemote directive forwards a request to a remote proxy when itself is acting as a proxy server (forward proxy). For example:
ProxyRemote http://www.somesite.com http://another...
forwards a request for http://www.somesite.com to another proxy server running at another-proxy.local:8080 .
ProxyRemote http http://http-proxy.remote.com
forwards all HTTP requests to the remote proxy http://http-proxy.remote.com .
It must be emphasized that ProxyRemote only functions when:
The Apache server is configured as a forward proxy, i.e., ProxyRequests On .
The user's browser is configured to use the Apache instance as a proxy server.
The second point above clearly differentiates ProxyRemote from ProxyPass , which is the directive to use for reverse proxy.
Created by voodoo on November 24, 2010 23:34:52
Last update: November 24, 2010 23:36:08
PostgreSQL provides two distinct ways to store binary data: Binary data can be stored in a table using the data type bytea . By using the Large Object feature which stores the binary data in a separate table in a special format and refers to that table by storing a value of type oid in your table. Different methods are used to access the BLOBs depending on which storage type you choose: To use the bytea data type you should use the getBytes() , setBytes() , getBinaryStream() , or setBinaryStream() methods. To use the Large Object functionality you can use either the LargeObject class provided by the PostgreSQL JDBC driver, or by using the getBLOB() and setBLOB() methods. Using setBinaryStream on an OID column yields...