Speed up ssh logins

By Joao

Share the same ssh connection for different sessions. This means only the first one actually needs to login:

Host *
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r

Disable GSSAPIAuth, sometimes ssh takes a long time figuring out if it needs to use it or not

Host *
GSSAPIAuthentication no

categoriaTechnology commentoNo Comments dataJuly 27th, 2013
Read All

Force cfengine client to download/execute new promises

By Joao

On the hub:

on the hub:
cf-agent -K -f failsafe.cf
cf-promises

On the client

rm -f /var/cfengine/inputs/cf_promises_validated
cf-agent -K -f failsafe.cf # Download new promises
cf-agent -vK #execute new promises in verbose mode

categoriaTechnology commentoNo Comments dataJuly 5th, 2013
Read All

Ignore SSL certificates in LWP

By Joao

Recents version of Perl’s LWP validate the server’s SSL certificate on HTTPS requests. To revert to the old behaviour (ignore server certificate):


use LWP::UserAgent;
use IO::Socket::SSL qw();

my $ua = LWP::UserAgent->new();
$ua->ssl_opts( SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE, SSL_hostname => '', verify_hostname => 0 );

The SSL_hostname option is only required if you intend to fake the “Host” header ( so that it doesn’t mismatch with a similar header in the SSL layer ).

categoriaTechnology commentoNo Comments dataJuly 4th, 2013
Read All

Using tcpdump to capture network traffic on the command line

By Joao

To listen for traffic and write to stdout:
tcpdump -i -n -A expression

  • -i The interface id to listen on ( run tcpdump -D to get a list of available interfaces )
  • -n Don’t convert host addresses to names (avoid dns resolution)
  • -A Print packets in ASCII, excluding link level headers. Use -X for both hex and ASCII printout.

See man pcap-filter for a full description of ‘expression’
Examples include:
tcpdump -i 11 -n -A -s 65535 port 80
tcpdump -i 11 -n -A -s 65535 dst host 10.0.0.1

Other usefull flags:
-w write packets to a file which can later be replayed with -r

categoriaTechnology commentoNo Comments dataSeptember 7th, 2011
Read All

Sendmail from/to example

By Joao

Sending an email from the command line using sendmail with the send/to fields set:

sendmail -v -f sender@zonalivre.org recipient@zonalivre.org
Subject: Test Email
Email content here

.

categoriaTechnology commentoNo Comments dataAugust 16th, 2011
Read All

Turn off blinking/visual bell in gnome 3

By Joao

When using a terminal, tab auto completion makes the whole screen blink (aka visual bell). I find this annoying as hell. To work around it:

Start gconf-editor
Navigate to /apps/metacity/general
Either turn off “visual_bell”, or change “visual_bell_type” from “fullscreen” to “frame_flash”

categoriaTechnology commentoNo Comments dataJuly 18th, 2011
Read All

winetricks fails when installing vcrun2010

By Joao

Problem:
You run
winetricks vcrun2010

But get the message:

Using native,builtin override for following DLLs: msvcr100
Executing early_wine regedit c:\winetrickstmp\override-dll.reg
——————————————————
Executing wget -O msxml3.msi -nd -c –read-timeout=300 –retry-connrefused –header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi
–2011-03-12 23:10:19– http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi
Resolving download.microsoft.com… 213.199.149.141, 213.199.149.144
Connecting to download.microsoft.com|213.199.149.141|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2011-03-12 23:10:20 ERROR 404: Not Found.

——————————————————
Note: command ‘wget -O msxml3.msi -nd -c –read-timeout=300 –retry-connrefused –header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi’ returned status 8. Aborting.
——————————————————
——————————————————
vcrun2010 failed
——————————————————

The VC2010 runtime redistributable setup needs to load msxml3. winetricks tries to download it from a location in the microsoft.com website where it is no longer available. Instead, search the web for the file “msxml3.msi” and edit winetricks to point to it, eg:


vi winetricks

Find the load_msxml3 function, and replace the download location:

From:

w_download msxml3 http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi d4c2178dfb807e1a0267fce0fd06b8d51106d913

To:

w_download msxml3 ftp://ftp.uni-rostock.de/pub/tools/microsoft/XML/US/msxml3.msi

categoriaTechnology commento2 Comments dataMarch 13th, 2011
Read All

Adding a signatures to all messages in Microsoft Outlook

By Joao

Signature options are under:

Tools->Options->”Mail Format”->Signatures

categoriaTechnology commento1 Comment dataJanuary 6th, 2011
Read All

Query which files are installed by an RPM package

By Joao

rpm --query --filesbypkg techrx

categoriaTechnology commento2 Comments dataNovember 18th, 2010
Read All

Converting .flac to .mp3 in Linux

By Joao

flac -cd sourcefile.flac | lame -h - destfile.mp3

categoriaTechnology commento1 Comment dataMay 21st, 2010
Read All