Skip to content

Instantly share code, notes, and snippets.

View 641i130's full-sized avatar
🦀
Rewrite it in rust!

Caret 641i130

🦀
Rewrite it in rust!
View GitHub Profile
@ticean
ticean / SVN_Git_Mirror.md
Created January 3, 2012 21:14
SVN Git Mirror

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@xenomuta
xenomuta / httpd.asm
Last active January 4, 2024 13:53
httpd.asm: Arguably the world smallest web server. ( for GNU/Linux i386. Compile with nasm )
section .text
global _start
_start:
xor eax, eax
xor ebx, ebx
xor esi, esi
jmp _socket
_socket_call:
@DGivney
DGivney / httpd.asm
Last active January 4, 2024 13:58 — forked from xenomuta/httpd.asm
section .text
global _start
_start:
xor eax, eax ; init eax 0
xor ebx, ebx ; init ebx 0
xor esi, esi ; init esi 0
jmp _socket ; jmp to _socket
_socket_call:
@torkildr
torkildr / chromelight.py
Created January 28, 2014 09:13
Quick hack to make make Philips Hue light bulbs dim down when using Chromecast (or, more specifically, when certain apps are open).
#!/usr/bin/env python
import os
import requests
import libxml2
import time
import phue
import daemon
import lockfile
import signal
@lirenlin
lirenlin / gist:9892945
Last active April 21, 2024 17:27
i3 wm, hide window title bar
@felixjones
felixjones / pmx21.md
Last active May 6, 2024 15:53
PMX (Polygon Model eXtended) 2.0, 2.1 File Format Specifications

PMX (Polygon Model eXtended) 2.1

This is an English description of the .PMX file format used in Miku Miku Dance (MMD).

PMX is the successor to the .PMD format (Polygon Model Data).

This is work-in-progress! Please leave feedback in the comments.

Todo

@Brainiarc7
Brainiarc7 / fstab-generate-arch.md
Last active March 18, 2024 13:51
Generate fstab in Arch Linux

First, install arch-install-scripts:

sudo pacman -S --needed arch-install-scripts

Secondly, mount your partitions in all the internal hard drives.

Thirdly, generate and validate your config by piping it out to stdout:

@stvhwrd
stvhwrd / website-dl.md
Last active March 13, 2024 17:05
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@mjohnsullivan
mjohnsullivan / http_server.rs
Last active March 12, 2024 16:08
Simple HTTP server example for Rust
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust
// to work with Rust 1.0 beta
use std::net::{TcpStream, TcpListener};
use std::io::{Read, Write};
use std::thread;
fn handle_read(mut stream: &TcpStream) {
let mut buf = [0u8 ;4096];
@JLeClerc
JLeClerc / Python Subprocess - tailing output (the best way)
Last active April 8, 2024 18:47
Python Subprocess - tailing output (the best way)
# Run a subprocess and parse output line-by-line in real-time
# Note: if running Python in Bash file, use unbuffered mode (python -u).
proc = subprocess.Popen(['bash', 'my_file.bsh'], bufsize=0, stdout=subprocess.PIPE)
for line in iter(process.stdout.readline, b''):
log.info(line.decode('utf-8')[:-1]) # [:-1] to cut off newline char
proc.stdout.close()
proc.wait()
result = proc.returncode