Skip to content

Instantly share code, notes, and snippets.

View skunkworker's full-sized avatar

John Bolliger skunkworker

View GitHub Profile
@usmansaleem
usmansaleem / rpi2vpngateway.md
Last active March 3, 2023 11:23
Raspberry pi as PP2P vpn gateway

Goal

In Progress

Use Raspberry PI 2 as a PP2P VPN gateway so that devices on the network can be configure to use PI as gateway which should direct the internet traffic through VPN.

Setup

  • Modify main router to issue DHCP address so that PI can be assigned an IP address outside the range.
  • Connect PI using ethernet cable. WIFI may also be used, however, following instructions assume eth.
  • Setup PI with static IP address. Modify /etc/dhcpcd.conf with following contents (192.168.1.2 is PI ip address, 192.168.1.1 is the WAN router IP address):
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@dteoh
dteoh / rails_5_engine_tests.md
Last active April 28, 2018 03:31
Adding extra test paths to Rails 5 `rails test` command

In Rails 4.x, you could add extra test paths to rake test by overriding the Rake task like so:

Rake::Task['test:run'].clear

namespace :test do
  Rails::TestTask.new(:run) do |t|
    paths = ['test/**/*_test.rb']
    paths << 'engines/foo_engine/test/**/*_test.rb'

Prerequisites:

You'll need:

  1. A paid ngrok account
  2. A reserved domain on ngrok, e.g. the FQDN you're generating certs for
  3. A registed domain and access to change DNS records

How to

  1. Install certbot and ngrok
  • brew cask install certbot ngrok
@jonyardley
jonyardley / Dockerfile
Last active March 3, 2023 21:12
Precompile Ruby on Rails assets with Docker
ARG ASSET_HOST
RUN bundle exec rake ASSET_HOST=${ASSET_HOST} RAILS_ENV=production assets:precompile
@tzvetkoff
tzvetkoff / zwch.py
Last active January 2, 2018 08:20
Sublime Text plugin that tries to detect and mark zero-width characters
import sublime
import sublime_plugin
class ShowZeroWidthCharacters(sublime_plugin.EventListener):
"""
Tries to detect and mark zero-width joiners, non-joiners, and other invisible characters.
Most of the characters were detected by manually testing code points from C++ specs.
http://en.cppreference.com/w/cpp/language/identifiers
"""
@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@joker1007
joker1007 / Dockerfile
Last active July 4, 2022 13:55
Sample Dockerfile for rails app
FROM appbase
# install npm & bower packages
WORKDIR /root
COPY package.json bower.json /root/
RUN npm install --only=prod && \
npm cache clean && \
bower install --allow-root
# install gems
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@mmmries
mmmries / CssHelper.js
Created March 16, 2016 16:35
Client Specific Colorschemes in Javascript
var ColorConversion = require('helpers/ColorConversion');
/**
Used for parsing all css rules on the document
object and replacing any default brand color
instances with the client's brand color scheme.
@class CssHelper
@example
```javascript