Skip to content

Instantly share code, notes, and snippets.

View synsa's full-sized avatar

Steve Lang synsa

View GitHub Profile
@synsa
synsa / execute_on_router.sh
Created February 2, 2021 18:23 — forked from javikalsan/execute_on_router.sh
Simple Bash Script to execute a command on the router through telnet command
#!/bin/sh
# replace cmd1 for the command to execute
host=192.168.1.1
port=23
user=myuser
pass=mypass
cmd1='ifconfig wl0 down'
( echo open ${host}
@synsa
synsa / libvirt-kvm-docker.md
Created January 27, 2021 02:45 — forked from kosyfrances/libvirt-kvm-docker.md
Spin up a Libvirt VM (that supports nested virtualisation using KVM as Hypervisor) in a docker container.

Dockerfile

FROM ubuntu:18.04
RUN apt-get update -y && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils vagrant && \
    apt-get autoclean && \
    apt-get autoremove && \
    vagrant plugin install vagrant-libvirt
COPY startup.sh /
ENTRYPOINT ["/startup.sh" ]
@synsa
synsa / wsl_chefdk.ps1
Created January 21, 2021 11:02 — forked from bdwyertech/wsl_chefdk.ps1
Windows Subsystem for Linux - ChefDK
# Update to Latest Windows 10 Spring Refresh
# Install WSL
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
# Get Ubuntu installed - https://docs.microsoft.com/en-us/windows/wsl/install-on-server
wsl.exe
# Install ChefDK deb package
@synsa
synsa / wsl.conf
Last active January 21, 2021 06:26
[automount]
enabled = true
root = /
options = "metadata,uid=1000,gid=1000,umask=0022,fmask=11,case=off"
mountFsTab = false
crossDistro = true
[filesystem]
umask = 0022
@synsa
synsa / git-sync.sh
Last active December 29, 2020 18:32
git-sync bash script
#!/usr/bin/env bash
# Sync your project from anywhere
# Script powerful when paired with a cronjob to constantly
# pull in changes from upstream maintainer that may do constant commits.
# Such as in team environments
# HOW-TO:
# $ git-sync $HOME/code/projects/expressjs upstream/master
REPO=$1;
MAINTAINER=($(echo $2 | cut -d/ -f1))
@synsa
synsa / Capfile
Created December 26, 2020 09:36 — forked from troelskn/Capfile
Sample cap setup
# Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Include tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
@synsa
synsa / copy_subdir.rb
Created December 13, 2020 09:10 — forked from yyuu/copy_subdir.rb
a capistrano strategy to deploy sub-directory in repository with "copy" strategy
#!/usr/bin/env ruby
#
# a capistrano strategy to deploy sub-directory in the repository.
# this is a stuff like "remote_cache_subdir" strategy described in following page,
# but based on "copy" strategy of capistrano deploy recipe.
#
# http://stackoverflow.com/questions/29168/deploying-a-git-subdirectory-in-capistrano
#
require 'capistrano'
@synsa
synsa / README.md
Created December 12, 2020 10:23 — forked from kordless/README.md
Rust Server Deployment for Google Container Engine

Howdy Y'all! I'm @kordless on YouTube and I occasionally play and stream Rust, the game.

This repo is for deploying a Rust Server running on Google Container Engine. Google has a deal going where you can get $300 of free credits for a year on Google Cloud, so it's a good excuse to signup and run your own server. And no, I don't work for Google!

This deployment uses an image built by @dids, which is hosted on Docker Hub: https://hub.docker.com/r/didstopia/rust-server/

This deployment method can be used to start a small server to play with friends or practice building things. In a few days, I'll update the scripts to include a way to save the content you've created, in-game, with others who can then run their own servers and load your content in to explore it for themselves.

For now, start by navigating to Google Cloud and signup for an account. You'll need to enter some credit card details to get this going, but Google is giving you $300 in credits for the next year. Should be e

@synsa
synsa / fix-git-line-endings
Created October 16, 2020 06:44 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@synsa
synsa / fix-git-line-endings
Created October 16, 2020 06:44 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF