This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install ubuntu in virtual machine | |
# https://ubuntuforums.org/showthread.php?t=1481300 | |
# Get arch type of ubuntu | |
# i686 = 32 bit | |
# x86_64 = 64 bit | |
uname -m | |
# download forticlient | |
https://hadler.me/linux/forticlient-sslvpn-deb-packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Download this file | |
# cd /usr/local/etc/rc.d && fetch --no-verify-peer https://gist.githubusercontent.com/PieterScheffers/1ecd70a1bfe640afb98f3cac9630814b/raw/326033ce1c243fd7ecd018684e748234668cf9ff/vncserver | |
# | |
# Make the file executable with: | |
# /usr/local/etc/rc.d/vncserver (chmod +x) | |
# | |
# add to /etc/rc.conf | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# install docker | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
# install docker-compose | |
# https://docs.docker.com/compose/install/ | |
# install letsencrypt | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Source: https://stackoverflow.com/questions/32076878/logging-solution-for-multiple-containers-running-on-same-host | |
# Creator: Nate | |
names=$(docker ps --format "{{.Names}}") | |
echo "tailing $names" | |
while read -r name | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PM2 Startup script | |
# Source: https://0x0a14.de/pm2-startup-script-for-freebsd/ | |
# Made by: Johannes Tonn | |
# | |
# Download this file | |
# cd /usr/local/etc/rc.d && fetch https://gist.github.com/457769f2090c6b69cd9d | |
# | |
# Make the file executable with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Custom scripts here | |
echo "This is an extended entrypoint!" | |
# Run the original entrypoint located at | |
# /docker-entrypoint.sh | |
exec /docker-entrypoint.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/1388025/how-to-get-id-of-the-last-updated-row-in-mysql | |
# single row update | |
SET @update_id := 0; | |
UPDATE some_table SET column_name = 'value', id = (SELECT @update_id := id) | |
WHERE some_other_column = 'blah' LIMIT 1; | |
SELECT @update_id; | |
# Multiple rows updated | |
SET @uids := null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic login | |
#### authorized_keys on server | |
ssh-rsa...rest of local public key (.pub) | |
#### .ssh/config | |
Host some_server_alias # custom name of the host | |
HostName example.nl # hostname of the server | |
User some_user # user to login as | |
ForwardAgent yes # forward local keychain, so you can use bitbucket with local key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array literal (= []) is faster than Array constructor (new Array()) | |
// http://jsperf.com/new-array-vs-literal/15 | |
var array = []; | |
// Object literal (={}) is faster than Object constructor (new Object()) | |
// http://jsperf.com/new-array-vs-literal/26 | |
var obj = {}; | |
// property === undefined is faster than hasOwnProperty(property) | |
// http://jsperf.com/hasownproperty-vs-in-vs-undefined/17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minimum=30 | |
for pid in /proc/[0-9]*; do number_fds=$(ls $pid/fd | wc -l); if [ $number_fds -ge $minimum ]; then printf "PID %6d has %4d FDs\n" $(basename $pid) $(ls $pid/fd | wc -l); ps aux | grep $(echo $pid | cut -d/ -f3) | grep -v grep; fi; done |
NewerOlder