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
lukesUbuntu / clean-up-boot-partition-ubuntu.md
Created May 1, 2019 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64
View clean-up-boot-partition-ubuntu.md

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

Reference

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

1. Check the current kernel version

$ uname -r 
@lukesUbuntu
lukesUbuntu / gist:d656c233d71120063db37e03eacb425b
Created Mar 16, 2019 — forked from daveismyname/gist:8067095
Use Google finance calculator to convert currency with php
View gist:d656c233d71120063db37e03eacb425b
<?php
function convertCurrency($amount, $from, $to){
$data = file_get_contents("https://www.google.com/finance/converter?a=$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
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
lukesUbuntu / Response.php
Created Jan 3, 2018
Handy json output class
View Response.php
<?php
/**
* User: luke hardiman
* Date: 2/20/15
* Time: 11:23 PM
* @Description : Handy json output class
*/
namespace Api;
class Response
View dbdiff.sh
#!/bin/sh
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
lukesUbuntu / wholesalesms.php
Created Apr 8, 2017
basic wholesalesms class for sending txt messages
View wholesalesms.php
<?php
class wholesalesms {
var $api_key;
var $secret;
var $end_point;
public function wholesalesms($api_key,$secret,$end_point = 'https://app.wholesalesms.com.au/api/v2/'){
$this->api_key = $api_key;
$this->secret = $secret;
$this->end_point = $end_point;
@lukesUbuntu
lukesUbuntu / fix.sh
Last active Dec 26, 2016
fix for Error opening terminal: xterm-new.
View fix.sh
#add to profile or just run
export TERM=xterm
@lukesUbuntu
lukesUbuntu / install_sshpass.sh
Created Nov 16, 2016
Install sshpass on mac osx
View install_sshpass.sh
brew install http://git.io/sshpass.rb
@lukesUbuntu
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
Woraround
nano /etc/init.d/proftpd
Find this line:
start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
@lukesUbuntu
lukesUbuntu / npmpermfix.sh
Created Aug 21, 2016
EACCES: permission denied | npm You don't have access to this file fix
View npmpermfix.sh
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.