Linux

Misc Linux Stuff

Tesseract OCR

OSX: brew install imagemagick brew install tesseract –all-languages Debian/Ubuntu: apt-get install imagemagick tesseract\* Sample Usage:    convert input image to grayscale using imagemagik convert input.png -colorspace Gray output.tif     decode with tesseract tesseract output.tif result; cat result.txt

Continue Reading 0

SparkleShare + Dashboard

SparkleShare: # Run all of the following commands as the root su # Fetch the Dazzle script curl https://raw.github.com/hbons/Dazzle/master/dazzle.sh \ –output /usr/bin/dazzle && chmod +x /usr/bin/dazzle # Run the initial setup dazzle setup # Link SparkleShare clients using their link codes (found # on the client in the SparkleShare folder) dazzle link # Create a […]

Continue Reading 0

Bash Script Hosts file Ad Blocker

Put in cron or run manually. #!/bin/bash # If this is our first run, save a copy of the system’s original hosts file and set to read-only for safety if [ ! -f /etc/hosts.bak ] then echo “Saving copy of system’s original hosts file…” sudo cp /etc/hosts /etc/hosts.bak sudo chmod 444 /etc/hosts.bak fi # Perform […]

Continue Reading

Driftnet x64 Fix

apt-get source driftnet START COPY BELOW LINE ———https://bugzilla.redhat.com/attachment.cgi?id=134667——— — driftnet-0.1.6/image.c 2002-07-09 20:26:41.000000000 +0100 +++ driftnet-0.1.6.new/image.c 2006-08-22 21:14:38.000000000 +0100 @@ -15,29 +15,20 @@ static const char rcsid[] = “$Id: image. /* memstr: * Locate needle, of length n_len, in haystack, of length h_len, returning NULL. – * Uses the Boyer-Moore search algorithm. Cf. – * http://www-igm.univ-mlv.fr/~lecroq/string/node14.html […]

Continue Reading 0

Perl – Send Email via Secure Mail Server

#!/usr/bin/perl -w # Modules Needed: # apt-get install libssl-dev # perl -MCPAN -e shell # install Net::SSLeay # install IO::Socket::SSL # install Authen::SASL # install Net::SMTP::SSL use Net::SMTP::SSL; sub send_mail { my $to = $_[0]; my $subject = $_[1]; my $body = $_[2]; open(MYINPUTFILE, “<$ARGV[$0]“); # open for input my(@lines) = ; # read file […]

Continue Reading 0

USB hardware power on off

  Site: http://www.gniibe.org/ac-power-by-usb/ac-power-control.html Source: http://www.gniibe.org/software/ apt-get install libusb-dev gcc -o hub-ctrl hub-ctrl.c -lusb lsusb Usage: hub-ctrl [{-h HUBNUM | -b BUSNUM -d DEVNUM}] \ [-P PORT] [{-p [VALUE]|-l [VALUE]}] Version 1 /* * Copyright (C) 2006 Free Software Initiative of Japan * * Author: NIIBE Yutaka <gniibe at fsij.org> * * This file can be […]

Continue Reading

Broadvoice – Fastest proxy switcher for asterisk.

#!/bin/bash curhip=(`cat /etc/hosts | grep sip.broadvoice.com | awk ‘{ print $1 }’`) echo “Current IP: $curhip” chkip=”(`ping -c 2 sip.broadvoice.com`)” curiplow=(`echo $chkip | grep PING | grep -Eo ‘\b[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\b’ | uniq`) curlow=(`echo $chkip | grep -o ‘time\s[0-9]\+[^ms]‘ | awk ‘{ print $2 }’`) function getnewlow { echo “Testing: $1″ chkip=”(`ping -c 2 $1`)” curip=(`echo $chkip […]

Continue Reading 0

Powered by recycled bites and bytes.