Skip to content

Instantly share code, notes, and snippets.

View binkoni's full-sized avatar
🎯
Focusing

Byeonggon Lee binkoni

🎯
Focusing
View GitHub Profile
@binkoni
binkoni / vm-backup.sh
Last active July 4, 2018 17:14 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@binkoni
binkoni / gh-pages-deploy.md
Created April 11, 2019 15:53 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@binkoni
binkoni / README.md
Created July 26, 2019 14:40 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@binkoni
binkoni / fakedata.js
Created October 8, 2019 06:23 — forked from kakao-kong-j/fakedata.js
fakedata
const fakeDatabase =
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
@binkoni
binkoni / find-that-bastard.js
Created August 17, 2021 05:45 — forked from pepebe/find-that-bastard.js
JS: Find the event handler blocking events (event.preventDefault())
// Scenario: Some event handler is blocking events (event.preventDefault()) that shouldn't be blocked, i.e. because it binds to document instead of a more specific element
// 1) Place this before all other JavaScript
var originalPreventDefault = Event.prototype.preventDefault;
Event.prototype.preventDefault = function () {
// Lookup specific event you're expecting, i.e. pressing space
if (this instanceof KeyboardEvent && this.keyCode === 32) {
// This will log an error with full stack trace
make_error_to_see_stacktrace
@binkoni
binkoni / server.py
Created August 21, 2016 17:28 — forked from davidbgk/server.py
A very simple HTTP server in Python using wsgiref.simple_server
from cgi import parse_qs
from wsgiref.simple_server import make_server
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-Type', 'text/plain')]
start_response(status, headers)
if environ['REQUEST_METHOD'] == 'POST':
request_body_size = int(environ.get('CONTENT_LENGTH', 0))
request_body = environ['wsgi.input'].read(request_body_size)
node1 | SUCCESS => {
"hostvars[inventory_hostname]": {
"access_ip": "192.168.10.254",
"ansible_check_mode": false,
"ansible_config_file": "/home/gon/workspace/kubespray/ansible.cfg",
"ansible_diff_mode": false,
"ansible_facts": {},
"ansible_forks": 5,
"ansible_host": "192.168.10.254",
"ansible_inventory_sources": [

Keybase proof

I hereby claim:

  • I am binkoni on github.
  • I am binkoni (https://keybase.io/binkoni) on keybase.
  • I have a public key ASAADy0qOpC93M3xmHCOnTe0wn4EYHb9hF23LAzVNKoZ4wo

To claim this, I am signing this object: