Skip to content

Instantly share code, notes, and snippets.

code all day every day & code in my sleep..... zzzz

Luke Hardiman lukesUbuntu

code all day every day & code in my sleep..... zzzz
Block or report user

Report or block lukesUbuntu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
lukesUbuntu /
Created May 1, 2019 — forked from ipbastola/
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64


Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
lukesUbuntu / gist:d656c233d71120063db37e03eacb425b
Created Mar 16, 2019 — forked from daveismyname/gist:8067095
Use Google finance calculator to convert currency with php
View gist:d656c233d71120063db37e03eacb425b
function convertCurrency($amount, $from, $to){
$data = file_get_contents("$amount&from=$from&to=$to");
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
$converted = preg_replace("/[^0-9.]/", "", $converted[1]);
return number_format(round($converted, 3),2);
echo convertCurrency("10.00", "GBP", "USD");
lukesUbuntu / code extensions
Last active Mar 11, 2018
my fav code extensions
View code extensions
code --install-extension HookyQR.beautify
code --install-extension Kasik96.format-php
code --install-extension RolandGreim.sharecode
code --install-extension Shan.code-settings-sync
code --install-extension Tobiah.unity-tools
code --install-extension Unity.unity-debug
code --install-extension aaron-bond.better-comments
code --install-extension christian-kohler.npm-intellisense
code --install-extension chrmarti.regex
code --install-extension codezombiech.gitignore
lukesUbuntu / Response.php
Created Jan 3, 2018
Handy json output class
View Response.php
* User: luke hardiman
* Date: 2/20/15
* Time: 11:23 PM
* @Description : Handy json output class
namespace Api;
class Response
echo "Usage: dbdiff [user1:pass1@dbname1] [user2:pass2@dbname2] [ignore_table1:ignore_table2...]"
dump () {
up=${1%%@*}; user=${up%%:*}; pass=${up##*:}; dbname=${1##*@};
mysqldump --opt --compact --skip-extended-insert -u $user -p$pass $dbname $table > $2
rm -f /tmp/db.diff
lukesUbuntu / wholesalesms.php
Created Apr 8, 2017
basic wholesalesms class for sending txt messages
View wholesalesms.php
class wholesalesms {
var $api_key;
var $secret;
var $end_point;
public function wholesalesms($api_key,$secret,$end_point = ''){
$this->api_key = $api_key;
$this->secret = $secret;
$this->end_point = $end_point;
lukesUbuntu /
Last active Dec 26, 2016
fix for Error opening terminal: xterm-new.
#add to profile or just run
export TERM=xterm
lukesUbuntu /
Created Nov 16, 2016
Install sshpass on mac osx
brew install
lukesUbuntu / proftp fix.txt
Created Aug 23, 2016
fix proftp stopping service in virtualmin
View proftp fix.txt
The problem is due to ProFTPD not stopping in time to be restarted for log rotation
nano /etc/init.d/proftpd
Find this line:
start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
lukesUbuntu /
Created Aug 21, 2016
EACCES: permission denied | npm You don't have access to this file fix
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
sudo chown -R $USER:$GROUP ~/.cache
You can’t perform that action at this time.