Skip to content

Instantly share code, notes, and snippets.

@cyppst
cyppst / install.sh
Created February 9, 2019 03:18 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
#!/bin/bash
LOGFILE=./cctv_restart.log
NOW=$(date +%d%m%Y-%M:%S)
OUTPUT=$(displaycameras restart)
echo "Restarted @ "$NOW >> $LOGFILE 2>&1
@cyppst
cyppst / tightvncserver-setup-script.sh
Created December 4, 2018 23:45 — forked from daz/tightvncserver-setup-script.sh
Script to install VNC server and run at boot
# Setup VNC server
sudo apt-get install -y tightvncserver
mkdir -p "$HOME/.vnc"
vncpasswd -f <<< $PASSWORD > "$HOME/.vnc/passwd"
# VNC at startup
sudo tee /etc/init.d/tightvnc > /dev/null <<EOF
#!/bin/sh
# To mount remote directory:
sshfs <username>@<remote_host>:<remote_directory> <mountpoint>
# To unmount remote directory:
umount <mountpoint>
# To mount remote directory from server with specific port:
sshfs <username>@<remote_host>:<remote_directory> -p <2222>
# To use compression:
@cyppst
cyppst / hooks.json
Last active November 29, 2018 00:22
[
{
"id": "build",
"execute-command": "/quasar-build.sh",
"command-working-directory": "/src"
}
]
@cyppst
cyppst / license_accepter.sh
Created November 24, 2018 23:22
license_accepter.sh
#!/bin/bash
ANDROID_HOME=$1
check_android_home() {
if [ "$#" -lt 1 ]; then
if [ -z "${ANDROID_HOME}" ]; then
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter"
exit 1
else
ANDROID_HOME="${ANDROID_HOME}"
@cyppst
cyppst / timestamp_version_bump.js
Created November 20, 2018 20:56
Apache Cordova build hook to auto bump iOS CFBundleVersion and Android versionCode
#!/usr/bin/env node
var fs = require("fs"),
path = require("path");
var rootdir = process.argv[2];
if (rootdir) {
module.exports = function(context) {
##------------------------------------ ##
# -- new-alias -- #
# creates new alias & writes to file #
# $1 = alias new #
# $2 = alias definition #
##------------------------------------ ##
new-alias () {
if [ -z "$1" ]; then
echo "alias name:"
read NAME
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@cyppst
cyppst / docker-configure-tls.sh
Last active November 11, 2018 07:05 — forked from ivan-pinatti/docker-configure-tls.sh
Enable TLS in Docker service running in Ubuntu - #docker #docker-tls #tls #ubuntu
#!/usr/bin/env bash
: ' Script that enables TLS for Docker service in Ubuntu 16.x
This script is intended to be run as root
It;
- Generates the keys
- Creates the daemon.json Docker config file