Skip to content

Instantly share code, notes, and snippets.

@msantos
msantos / bpf.c
Last active September 5, 2024 02:33
Example of using bpf to capture packets
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@parse
parse / shell.c
Created May 11, 2011 07:31
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@epegzz
epegzz / Monaco_Linux-Powerline.ttf
Created January 18, 2012 17:19
Monaco for vim-powerline
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@KartikTalwar
KartikTalwar / Documentation.md
Last active September 24, 2024 20:03
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@ymjing
ymjing / Monaco for Powerline.md
Last active March 24, 2022 14:34
Powerline-patched Monaco for Windows and OSX

Powerline-patched Monaco for Windows and OSX

This font is manually patched with Fontforge. It includes the glyphs from DejaVu Sans Mono for Powerline.

I recommend DirectWrite-patched VIM builds. I'm using KaoriYa's build (http://www.kaoriya.net/software/vim/)

Usage

Add the following lines to your .vimrc/_vimrc:

@fpom
fpom / fswatch.py
Created May 28, 2015 17:40
Watch file system updates with gevent
import os, os.path, collections
import gevent, gevent.pool, gevent.queue
import platform
if platform.system() == "Windows" :
# see https://github.com/gevent/gevent/issues/459
import socket
event = collections.namedtuple("event", ["name", "path", "isdir"])

#前言 感謝小飛機掏出一台主機借我玩

ACCTON SAF4121I

原本想說裝個archlinux應該不難

殊不知這台只有console port 並沒有vga

#Trace Config

@pichuang
pichuang / About_Accton_SAU5081I-AC.md
Last active September 20, 2016 11:19
About Accton SAU5081I-AC Information
@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active August 18, 2024 02:58
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown: