Skip to content

Instantly share code, notes, and snippets.

View xfp-2013's full-sized avatar

신흥재 xfp-2013

  • 대한민국 경기도 수원시
View GitHub Profile
@xfp-2013
xfp-2013 / vultr-dynamic-dns.sh
Last active April 7, 2019 04:19
vultr dynamic dns
#!/bin/bash
#set -e
DOMAIN='domain.com'
NAME='sub1'
TYPE='A'
APIKEY=''
LASTIP=/tmp/`basename "$0"`
LASTJS="${LASTIP}.json"
@xfp-2013
xfp-2013 / nginx-compile.sh
Created March 18, 2019 10:32
nginx compile on alpine linux
#!/bin/sh
#set -e
apk add --no-cache --virtual .build-deps bash gcc libc-dev make openssl-dev pcre-dev zlib-dev linux-headers curl gnupg git libxml2-dev libxslt-dev gd-dev geoip-dev
git clone https://github.com/arut/nginx-rtmp-module.git -b v${NGINX_RTMP_VERSION} /tmp/ngx-rtmp-module
git clone https://github.com/arut/nginx-ts-module.git -b v${NGINX_TS_VERSION} /tmp/ngx-ts-module
git clone https://github.com/arut/nginx-live-module.git /tmp/ngx-live-module
curl -fSL https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -o /tmp/nginx.tar.gz
@xfp-2013
xfp-2013 / gist:dc352aaf9b017700938c5d0b02139c84
Created January 28, 2019 18:28
Capturing packets in ASCII Format
#!/bin/bash
#set -e
sudo tcpdump -vv -A -s 0 -i eth0 udp port 1900 and host 239.255.255.250
#!/bin/bash
# Gnome 3 can be customised from the command line via the gsettings command
# This script should help you to find what you're looking for by
# listing the ranges for all keys for each schema
for schema in $(gsettings list-schemas | sort)
do
for key in $(gsettings list-keys $schema | sort)
do
value="$(gsettings get $schema $key | tr "\n" " ")"
@xfp-2013
xfp-2013 / random_string.cpp
Last active March 18, 2018 17:12
random string
string random_string(size_t len)
{
stra str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
stra r_;
int pos;
random_shuffle(str.begin(), str.end());
srand(time(0));
while(r_.size() != len) {
@xfp-2013
xfp-2013 / asio::system_timer.hpp
Created March 18, 2018 15:18
asio::system_timer, asio::steady_timer
#include <asio.hpp>
typedef __UINT64_TYPE__ uint64;
asio::io_service iosvc;
asio::steady_timer t1(iosvc);
asio::system_timer t2(iosvc);
void time1(const std::error_code err, asio::steady_timer* tmr)
@xfp-2013
xfp-2013 / daemon.cpp
Created March 16, 2018 06:07
cpp daemonize
#include "daemon.h"
static stra pidf_;
void daemon::start(PCSA pidf)
{
pidf_ = pidf;
{
@xfp-2013
xfp-2013 / repo.sh
Created December 7, 2017 07:51
git repo list clone or fetch
#!/bin/bash
#set -e
repo=(
"https://github.com/jquery/jquery.git"
);
cur=`pwd`;
@xfp-2013
xfp-2013 / pdf-merge-using-gs.txt
Created June 19, 2017 15:21
PDF 파일 합치기
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf 1.pdf 2.pdf 3.pdf 4.pdf 5.pdf 6.pdf 7.pdf 8.pdf 9.pdf 10.pdf 11.pdf 12.pdf
@xfp-2013
xfp-2013 / node iconv-lite.js
Last active June 17, 2017 09:51
nodejs 7.6, request v2.81, iconv-lite v0.4.18
// request v2.81 + iconv-lite v0.4.18
var ICONV = require('iconv-lite');
var request = require('request');
request.get(opt)
.pipe(ICONV.decodeStream('euc-kr'))
.collect(function(err, decodedBody)
{
console.log(decodedBody.toString());