Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
GO_VERSION=${GO_VERSION:=1.15.2}
cd /tmp/ \
&& wget -q https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz \
&& rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go*.tar.gz \
&& rm go$GO_VERSION*.gz
echo "Creating default Go folders"
@huglester
huglester / update-gminer.sh
Last active December 26, 2019 20:14 — forked from rigamp/update-ttminer.sh
Update Hive TT-Miner to 3.0.7 Beta 1
#!/bin/sh
# (miner stop || true) && cd /tmp && curl -L --insecure -s -O https://gist.githubusercontent.com/huglester/14ff9b5b8b785303d028e1a4ad86c728/raw/update-gminer.sh -o update-gminer.sh && screen -dmS updater bash update-gminer.sh
dt=$(date '+%Y-%m-%d_%H:%M:%S');
DIRECTORY=/hive/miners/gminer/1.69
rm -fr /tmp/gminer
@huglester
huglester / convert_ploop_to_simfs.sh
Created September 11, 2018 06:47 — forked from dlage/convert_ploop_to_simfs.sh
Bash script to convert an OpenVZ ploop container back to simfs
#!/bin/sh
# ./convert_ploop_to_simfs.sh VEID
# chmod +x convert_ploop_to_simfs.sh
rsync_options='-aHv'
partition='vz'
if [ ! -e /etc/vz/conf/$1.conf ]; then
echo "Virtual server configuration file: /etc/vz/conf/$1.conf does not exist."
exit 1
fi
if [ ! -d /$partition/private/$1/root.hdd ]; then
@huglester
huglester / phpenv-ubuntu-xenial.sh
Created June 14, 2018 12:32 — forked from christopher-hopper/phpenv-ubuntu-xenial.sh
Install phpenv on Ubuntu 16.04 LTS (xenial)
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Check OS.
if [[ ! "${OSTYPE}" =~ "^linux" ]] || [[ ! "$(lsb_release -c 2>/dev/null)" =~ "xenial" ]]; then
(>&2 echo "Error: This script is for Ubuntu 16.04 LTS (xenial) not '${OSTYPE}'.")
exit 1;
fi
sudo apt-get update
@huglester
huglester / HLS_dvr.sh
Created January 9, 2017 14:01 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from https://github.com/alloy/terminal-notifier
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
@huglester
huglester / transfer
Created March 1, 2016 19:11
This little bash scripts allows you to transfer DirectAdmin accounts to a new server. It first checks if the account is already backed up or installed on the new server (for security). If not existing on the new server, it starts the backup and waits for it to finish. Once finished, it will copy the backup to the new server and starts the restore.
#!/bin/bash
password="******"
target="127.0.0.1"
if [ -z "$1" ]; then
echo "Please give me the account to backup. ";
exit 0
fi
@huglester
huglester / action.php
Created October 22, 2015 11:24 — forked from JokubasR/action.php
auto zip code
/**
* @author Jokūbas Ramanauskas
* @since 2015-03-26
*
* Fetches postcode by given address information
*
* @return bool
*/
public function getPostCodeByAddress()
{
<?php
/**
* Lietuviškų vardų linksniai.
*
* @author Dainius Kaupaitis <dainius at kaupaitis dot lt>
* @copyright Copyleft (ↄ) 2011, Dainius Kaupaitis
* @version 1.0
* @package Vardai
*/
Package: libapache2-mod-php5 libapache2-mod-php5filter
Pin: version 5.2*
Pin-Priority: 1001
Package: php5-suhosin
Pin: version 0.9.2*
Pin-Priority: 1001
Package: php5 php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-enchant php5-gd php5-gmp php5-ming php5-xcache
Pin: version 5.2*
upstream mailcatcher {
sticky;
server appserver.domain.ch:3000 max_fails=1 fail_timeout=2s;
}
server {
listen 80;
server_name mailcatcher.domain.ch;
client_max_body_size 4G;
keepalive_timeout 5;