Skip to content

Instantly share code, notes, and snippets.

View peterc's full-sized avatar
🏠
Working from home

Peter Cooper peterc

🏠
Working from home
View GitHub Profile
@ChristopherA
ChristopherA / FFmpeg.sh
Created November 30, 2019 03:01 — forked from AffanIndo/FFmpeg.sh
FFmpeg Cheat Sheet
# batch convert
for i in *.mp4; do ffmpeg -i "$i" "${i%.mp4}.webm"; done
# convert from one format to another
ffmpeg -i input.mp3 output.wav
# convert from one video format to another ("-qscale" value are 0-10, 0 is the best)
ffmpeg -i input.mp4 -qscale 0 output.webm
# convert video to audio (sometimes this one is better than the custom one below)
@webchi
webchi / Dockerfile
Created October 11, 2019 13:08
Rails Postgre Docker MultiStage
FROM ruby:2.5.5-alpine3.9 as builder
WORKDIR /app
ARG RAILS_MASTER_KEY
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_IGNORE_MESSAGES=1 \
BUNDLE_GITHUB_HTTPS=1 \
BUNDLE_FROZEN=1 \
@htr3n
htr3n / macos-ramdisk.md
Last active March 16, 2026 22:26
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log > requests.txt
@amirrajan
amirrajan / subspace.rb
Created February 27, 2019 21:50
Initial work for a subspace clone written on top of a game engine I'm working out that hasn't been released yet.
class Game
attr_accessor :_
def default_ship x, y, heading
_.new(:ship) do |s|
s.x = x
s.y = y
s.dy = 0
s.dx = 0
s.heading = heading
@fnky
fnky / ANSI.md
Last active April 6, 2026 23:24
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@hsed
hsed / vastai.md
Last active December 11, 2023 22:08
Vast.ai VPN Setup Commands

Commands

Remote => Server/GPU Computer Client => You/Dumb Computer

SSH and tunnel a port

This allows you to later run jupyterlab at 8080 on remote pc and its tunneled so u can view stuff in client.

ssh -p <PORT> <REMOTE_USER>@<REMOTE_IP> -L 8080:localhost:8080
@sheerun
sheerun / click.m
Last active September 29, 2019 11:19
Script for drawing on http://editfight.com/
// Compile with:
// gcc -o click click.m -framework ApplicationServices -framework Foundation
//
// Usage:
// ./click -x pixels -y pixels
// At the given coordinates it will click and release.
//
// From http://hints.macworld.com/article.php?story=2008051406323031
#import <Foundation/Foundation.h>
#import <ApplicationServices/ApplicationServices.h>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace WebApplication1
{
public class Program
{
public static void Main(string[] args)
@skeeto
skeeto / Makefile
Created January 17, 2018 20:16
r/dailyprogrammer Challenge #347 : Linear Feedback Shift Register
CFLAGS = -std=c99 -Wall -Wextra -O3 -g3
lfsr: lfsr.c