Skip to content

Instantly share code, notes, and snippets.

@jpweber
jpweber / gist:3924305
Created October 20, 2012 18:38 — forked from stefanschmidt/toggle-screen-sharing
Enable Screen Sharing on Lion via Command Line Interface
# Enable Screen Sharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
# Disable Screen Sharing
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
@jpweber
jpweber / .gitignore
Created December 6, 2013 15:22 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// http://www.marco.org/2014/04/29/atp-shirts
//
// By Troy Gaul, June 2, 2014.
//
// Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license.
// https://gist.github.com/marcoarment/2542cd28cb5df0aa97d8
import UIKit
module WAAD
class Connector
attr_reader :client
def initialize
@client = connection(credentials)
end
def credentials
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@jpweber
jpweber / tomcat-service.sh
Last active March 14, 2017 17:48 — forked from lesstif/tomcat-service.sh
RHEL/CentOS tomcat7 init.d service script.
#!/bin/bash
#
# tomcat
#
# chkconfig: 345 96 30
# description: Start up the Tomcat servlet engine.
#
# processname: java
# pidfile: /var/run/tomcat.pid
#
@jpweber
jpweber / wildcard-ssl-cert-for-testing-nginx-conf.md
Created May 5, 2016 14:22 — forked from sr75/wildcard-ssl-cert-for-testing-nginx-conf.md
create a self signed wildcard ssl cert for testing with nginx.conf example

just change out app_name for your purposes

openssl genrsa 2048 > app_name-wildcard.key

openssl req -new -x509 -nodes -sha1 -days 3650 -key app_name-wildcard.key > app_name-wildcard.cert

# Common Name (eg, your name or your server's hostname) []:*.app_name.com

openssl x509 -noout -fingerprint -text < app_name-wildcard.cert > app_name-wildcard.info
@jpweber
jpweber / gist:3020c5ccba7f80f6df66c8768b81e1eb
Created August 17, 2016 01:57 — forked from philips/gist:7310435
Setting up swap on coreos

Setup a swap file in the stateful partition

Run these commands as root to create a 512 megabyte swap.

fallocate -l 512m /media/state/512MiB.swap
chmod 600 /media/state/512MiB.swap
mkswap /media/state/512MiB.swap
@jpweber
jpweber / gist:ab162e0f0612f615c1cabbd936e20d72
Created September 7, 2016 15:08 — forked from jiecuoren/gist:0d0bff2efa48e03c2fc5
when use fish, something you will find error: E79: Cannot expand wildcards
open ~/.config/fish/config.fish
add: set -x SHELL /bin/bash
@jpweber
jpweber / go_port_forwarding.go
Created April 28, 2017 21:26 — forked from qhwa/go_port_forwarding.go
network port forwarding in go lang
package main
import (
"fmt"
"io"
"net"
)
func main() {
ln, err := net.Listen("tcp", ":8080")