Default image

mount windows share on a linux box

First install smbmount that should be on smbfs package, for Debian use something like: sudo apt-get install smbfs To try and access, create a new mounting point and connect: sudo mount -t smbfs -o username=<user>,workgroup=<domain> //winserver/share1 /share /share1 To make it permanent add this line to your /etc/fstab as root: //winserver/share1 /share/share1 smbfs credentials=/home/user/credentials,uid=user,gid=user,dmask=700,fmask=700 0 0 In order to avoid having passwords on your fstab create a file /home/user/credentials like this: ...

June 18, 2007 · 1 min · 74 words · João Malcata
Default image

web stress test tool

Tired of “time wget”, apache has a simple stress tool “apache benchmark” that goes like this: ab -kc 10 -t 10 -v 4 -A user:pass "https://uri/dir/file?param=x" > ab_result.txt

June 8, 2007 · 1 min · 28 words · João Malcata
Default image

Check valid email addresses

Filter invalid email addresses using shell script: Check for valid domain names cat email_addr.txt | cut -d "@" -f 2 | sort -u| xargs -I {} host -t MX '{}' | grep "not found"; Check for email address RFC compliance cat email_addr.txt | egrep "^[a-Z0-9,\!\#\$\%\&'\\*\+/=\?\^\\_\`\{\|\}\~\-]+(\.[a-Z0-9,\!\#\$\%\&'\\*\+/=\?\^\_\`\{\|\}\~\-]+)\*@[a-Z0-9-]+(\.[a-Z0-9-]+)\*\.([a-Z]{2,})$"

June 1, 2007 · 1 min · 45 words · João Malcata
Default image

opacity bugs on Ubuntu with Beryl

If you are experiencing opacities issues with some windows just go to Beryl Settings Manager, pick Window Management and then check “Set Window Attribs by various criteria” selecting “Disable ARGB visual” add to the inclusion list an entry, example for Terminal Server Client: c:rdesktop:1

April 3, 2007 · 1 min · 44 words · João Malcata
Default image

Blank window on java applications under Beryl on Ubuntu

If you are getting a blank (grey) window with some java applications under Beryl that once you change Metacity works fine, just add the following line to your .bashrc and it should start working. export AWT_TOOLKIT=MToolkit

March 31, 2007 · 1 min · 36 words · João Malcata
Default image

post file request with curl

curl -d '@file.xml' https://website/path/file

March 6, 2007 · 1 min · 4 words · João Malcata
Default image

using openssl to encrypt/decrypt content

Here you can find and sample on how to encrypt and decrypt content using OPENSSL. This sample goes with 3DES but it is valid for other chiphers. Notice the password will be requested to do the encryption. Encoding foo.txt openssl enc -des3 -in foo.txt -out foo.3des Decoding foo.3des openssl enc -d -des3 -in foo.3des -out bar.txt

February 21, 2007 · 1 min · 56 words · João Malcata
Default image

bash shell shortcuts

____________CTRL Key Bound_____________ Ctrl + a - Jump to the start of the line Ctrl + b - Move back a char Ctrl + c - Terminate the command Ctrl + d - Delete from under the cursor Ctrl + e - Jump to the end of the line Ctrl + f - Move forward a char Ctrl + k - Delete to EOL Ctrl + l - Clear the screen Ctrl + r - Search the history backwards Ctrl + R - Search the history backwards with multi occurrence Ctrl + u - Delete backward from cursor Ctrl + xx - Move between EOL and current cursor position Ctrl + x @ - Show possible hostname completions Ctrl + z - Suspend/ Stop the command\ ...

January 19, 2007 · 2 min · 347 words · João Malcata
Default image

easy ssh tunnel

Create a dynamic port forwarding socks proxy to a remote server via ssh: ssh -D port bind_server -l bind_user Access a remote service on a local lan behind a bind server via ssh forwarding: ssh bind_address -l bind_user -L port:host:hostport

January 8, 2007 · 1 min · 40 words · João Malcata
Default image

Vmware on linux with a NTFS file system

If you have a virtual machine running on NTFS, your virtual machine does not boot and you find errors in the log file like this one: ... FILEIO: Unknown filesystem 0x65735546 for directory ... ... Then insert this line in our .vmx file. Just don’t ask me why, it just works. mainMem.useNamedFile=FALSE

November 10, 2006 · 1 min · 52 words · João Malcata