Skip to content

Instantly share code, notes, and snippets.

View rujmah's full-sized avatar
👨‍🚀
Looking to the future

Robin Mayfield rujmah

👨‍🚀
Looking to the future
View GitHub Profile
@rujmah
rujmah / .railsrc
Created February 19, 2018 20:32
Rails RSpec set up (Rails 5.1.5)
-d=postgresql
-T
--skip-coffee
@rujmah
rujmah / README.md
Last active March 8, 2018 09:16
Simple markdown note-taking bash script using Vim to Dropbox via command line

Simple Note-taking from command line

What it does:

  • Notes will appear in with ISO date prefix in directory
  • Running the command multiple times a day will re-open that days notes
  • Assumes you have a Dropbox account (or some directory) at the path below
  • Tested on Ubuntu 16.04 and 17.10

Implementation:

provider "heroku" {
email = "test@example.com"
api_key = "call heroku auth:token"
}
resource "heroku_app" "default" {
name = "herokutest"
region = "us"
config_vars {
@rujmah
rujmah / web-servers.md
Created February 21, 2017 17:35 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rujmah
rujmah / centos_add_ports.md
Created December 9, 2016 18:15
add ports on Centos 7

Review ports:

sudo semanage port -l | grep http_port_t

Add port:

sudo semanage port -a -t http_port_t -p tcp 8024
@rujmah
rujmah / resize_centos.md
Created December 8, 2016 17:51
Resizing Centos 6 8GB root partition with Fdisk

From this forum post:

Here are the steps i used to fix it.
Note that any mistake in recreating the partion will result in losing all data and/or the server will not reboot.
I would do this as the first step on a newly created instance.

I have marked the steps with <<#>> in the block below, so the are not a part of the command.
You need root permissions, so do a "sudo sh" if you are not root.
@rujmah
rujmah / express-multer-example-route.js
Created June 9, 2016 17:06
Express Multer Example Route
var multer = require('multer');
var fs = require('fs');
var copyFileSync = function (in, out) {
fs.createReadStream(in)
.pipe(fs.createWriteStream(out));
}
app.post('/upload', multer({dest: './uploaddir/'}).single('ffup'), function (req, res, next) {
console.log('body: '+ JSON.stringify(req.body));
@rujmah
rujmah / docker_cheatsheet.md
Last active December 15, 2016 18:03
docker cheatsheet

Remove all non running containers: docker rm $(docker ps -a -f="status=exited" -q) see also Docker filtering

Remove unused images docker rmi $(docker images --filter "dangling=true" -q --no-trunc) (but check link for more)

Get list IP of all running containers docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq) (StackOverflow answer)

One liner to stop / remove all of Docker containers:

@rujmah
rujmah / command.txt
Last active August 29, 2015 14:24 — forked from nrk/command.txt
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: