Miscellaneous

Add Parameter to URL – JQUERY

Add Parameter to URL – JQUERY function addOrUpdateUrlParam(name, value) { var href = window.location.href; var regex = new RegExp(“[&\\?]” + name + “=”); if(regex.test(href)) { regex = new RegExp(“([&\\?])” + name + “=\\d+”); window.location.href = href.replace(regex, “$1” + name + “=” + value); } else { if(href.indexOf(“?”) > -1) window.location.href = href + “&” + […]

Miscellaneous

Useful Net::SSH2 commands

#!/usr/bin/perl use warnings; use strict; use Net::SSH2; use Data::Dumper; # see maillist archives at # http://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users my $ssh2 = Net::SSH2->new(); $ssh2->connect(‘localhost’) or die “Unable to connect Host $@ \n”; #this works for passwords #$ssh2->auth_password(‘z’,’ztester’) or die “Unable to login $@ \n”; #do key authorization like commandline shell # ssh -o PreferredAuthentications=publickey localhost # See: http://cfm.gs.washington.edu/security/ssh/client-pkauth/ […]

Miscellaneous

Debian Install Packages behind Firewall

Debian Install Packages behind Firewall apt-get –print-uris install mysql-server -y Will print out the URL for the package and dependancies; ‘http://mirrordirector.raspbian.org/raspbian/pool/main/liba/libaio/libaio1_0.3.109-3_armhf.deb’ libaio1_0.3.109-3_armhf.deb 8944 MD5Sum:ddc43710db3f102df9477a8a95f025ad ‘http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server-core-5.5_5.5.40-0+wheezy1_armhf.deb’ mysql-server-core-5.5_5.5.40-0+wheezy1_armhf.deb 3060608 MD5Sum:9a8f4620799fcceb4567433caad2434e ‘http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server-5.5_5.5.40-0+wheezy1_armhf.deb’ mysql-server-5.5_5.5.40-0+wheezy1_armhf.deb 1729934 MD5Sum:98fe33dd64039ba120d1aa77e0992fa7 ‘http://mirrordirector.raspbian.org/raspbian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-2+deb7u1_armhf.deb’ heirloom-mailx_12.5-2+deb7u1_armhf.deb 253508 MD5Sum:6155feba05b677f5f01eb5b53ae4ba2d ‘http://mirrordirector.raspbian.org/raspbian/pool/main/libh/libhtml-template-perl/libhtml-template-perl_2.91-1_all.deb’ libhtml-template-perl_2.91-1_all.deb 72020 MD5Sum:b25cc0a02e43fe4b5b46a01af3e98c4c ‘http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server_5.5.40-0+wheezy1_all.deb’ mysql-server_5.5.40-0+wheezy1_all.deb 73872 MD5Sum:b49873c3a32d33f6186e779202f6a87e   Cut out the URLs and put them into a file. […]

Miscellaneous

Quick – Install Package on a Firewalled Server

On the firewalled/vpnd server; 1. find the package URL apt-get –print-uris install dos2unix 2. wget over ssh from an internet bound server on the same network ssh use@somehost ‘wget -O – http://mirrordirector.raspbian.org/raspbian/pool/main/d/dos2unix/dos2unix_6.0-1_armhf.deb’ >> dos2unix_6.0-1_armhf.deb 3. dpkg -i dos2unix_6.0-1_armhf.deb

Miscellaneous

JQUERY setLocale Errors

A number of JQUERY plugins can throw up syntax errors after setting setlocale(“LC_ALL”,XXX.utf8)   Make sure you change back the LC_NUMERIC variable;   setlocale (LC_ALL, $language); setlocale(LC_NUMERIC, ‘C’);      

Miscellaneous

Opt out of BT FON – BT Openzone

Opt out of BT FON – BT Openzone BT may activate your BT home hub to automatically become a BT openzone public hub!! Little do most people know that when you sign up to BT you are automatically opted IN to this service!!! Yes annoying. You can opt out … this link worked for me: […]