Skip to content

Instantly share code, notes, and snippets.

View ScottJWalter's full-sized avatar
🔮
Particle. Wave. It's all data.

Scott Walter ScottJWalter

🔮
Particle. Wave. It's all data.
View GitHub Profile
@SkaTeMasTer
SkaTeMasTer / log-rotate
Created February 13, 2017 08:51
Log rotate is important to keep the SD cards on Raspberry pi from corruption, disable any logging when possible (after debugging)
Logfile RoATING file operations using UNIX logrotate utility.
=============================================
+ Rotate the log file when file size reaches a specific size
+ Continue to write the log information to the newly created file after rotating the old log file
+ Compress the rotated log files
+ Specify compression option for the rotated log files
+ Rotate the old log files with the date in the filename
+ Execute custom shell scripts immediately after log rotation
+ Remove older rotated log files
@danielvlopes
danielvlopes / hello_world.rb
Created January 26, 2017 16:21
Sample IFTTT service
IFTTT_CHANNEL_KEY = "REPLACE_ME"
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "rails", "~> 5.0"
end
require "action_controller/railtie"
@otkrsk
otkrsk / multiple-ssh-authkeys.md
Last active May 6, 2024 14:12
Add multiple SSH keys to the authorized_keys file to enable SSH authentication when connecting to a server.

Step 1: Generate first ssh key Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.

workstation 1 $ ssh-keygen -t rsa

Finally, copy your public key to your remote server using scp

@chranderson
chranderson / nvmCommands.js
Last active April 19, 2025 05:20
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active January 30, 2025 19:01
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@copperlight
copperlight / .bashrc
Created August 11, 2016 16:27
Window Subsystem for Linux ssh-agent Configuraton
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
@takluyver
takluyver / make_nb.py
Created July 21, 2016 13:09
Make a notebook from a script
"""Create a notebook containing code from a script.
Run as: python make_nb.py my_script.py
"""
import sys
import nbformat
from nbformat.v4 import new_notebook, new_code_cell
nb = new_notebook()
#!/bin/bash
# Instructions to run
# create-reminder "Say thanks to Luis for this wonderful IFTTT recipe!"
# Instructions to configure
# Save this file as /usr/local/bin/create-reminder
# Run chmod +x /usr/local/bin/create-reminder
# Change the following lines
event_name="create_reminder"
@jgilfillan
jgilfillan / RHeader.r
Created August 19, 2015 03:52
R include to be run at the top of each R script.
###################################################################################################
#
# Descr: This is a standard header script to be run at the beginning of each R script
# It loads the standard packages and a password prompt function
# Usage: At the top of the r script, place the following text:
# source("[PATH TO RHeader.r]\\RHeader.r")
# Author: Josh Gilfillan
# Date: 20150326
#
###################################################################################################
@leucos
leucos / .git_hooks_pre-commit
Last active March 27, 2025 21:36
ansible-vault pre-commit hook
#!/bin/bash
#
# Pre-commit hook that verifies if all files containing 'vault' in the name
# are encrypted.
# If not, commit will fail with an error message
#
# Original author: @ralovely
# https://www.reinteractive.net/posts/167-ansible-real-life-good-practices
#
# File should be .git/hooks/pre-commit and executable