Skip to content

Instantly share code, notes, and snippets.

View Salada's full-sized avatar

SaladaQoo Salada

  • Ddong
  • Suwon. Kyong-Ki. Republic of Korea.
View GitHub Profile
@Salada
Salada / preprocessor_fun.h
Created August 2, 2018 08:00 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@Salada
Salada / preprocessor_fun.h
Created August 2, 2018 08:00 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@Salada
Salada / fuck.gs
Created June 24, 2018 03:29
병신같은 스크립트
var url = "https://94he6yatei-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.24.5%3Binstantsearch.js%202.3.3%3BJS%20Helper%202.23.0&x-algolia-application-id=94HE6YATEI&x-algolia-api-key=2414d3366df67739fe6e73dad3f51a43"
var modelParser = function(str) {
var baseModel = {
"requests":[
{
"indexName":"steamdb",
"params":"query="+str+"&hitsPerPage=20&maxValuesPerFacet=1000&page=0&facets=%5B%22tags%22%2C%22multiplayerCategories%22%2C%22categories%22%2C%22vrCategories%22%2C%22oslist%22%2C%22price_us%22%2C%22appType%22%2C%22userScore%22%2C%22developer%22%2C%22publisher%22%5D&tagFilters=&facetFilters=%5B%5B%22appType%3AGame%22%5D%5D"
},
{
@Salada
Salada / gist:5305ad624a67f18d9026c53ef8bf9a95
Last active April 21, 2017 15:27 — forked from httpdss/gist:948386
Mysql general log parser
#!/usr/bin/perl
#use strict;
use Data::Dumper;
use Getopt::Long;
# author: Gavin Towey, 2008 gtowey@gmail.com
# todo, add "follow thread" capability
# so we can give a process name or thread id & see
# all activity in sequence for each thread
@Salada
Salada / keybase.md
Created December 21, 2016 04:27
Keybase

Keybase proof

I hereby claim:

  • I am Salada on github.
  • I am saladaqoo (https://keybase.io/saladaqoo) on keybase.
  • I have a public key whose fingerprint is 0C73 1E30 127A BA92 08AF 3D3E A103 9EC0 8B94 4C7D

To claim this, I am signing this object:

@Salada
Salada / install_jenkins_plugin.sh
Created September 29, 2016 16:42 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@Salada
Salada / aws-docker-high-tracffic-kernel.md
Created October 20, 2015 13:25 — forked from ruseel/aws-docker-high-tracffic-kernel.md
AWS에서 docker를 쓸 때 high traffic server라면 이렇게

AWS에서 docker를 쓸 때 high traffic server라면 이렇게 하는 것이 좋겠다. amazon linux를 쓴다고 하자.

ulimit

ulimit를 올려주어야 한다. /etc/security/limit.conf 에서 고쳐주어도 docker에는 적용되지 않는다. limit.conf는 PAM을 통해서 로그인했을 때만 먹는 설정이라 그렇다. docker로 띄운 process의 pid를 찾고 cat /proc/<pid>/limits를 실행해서 보면 적용되었는지 아닌지 확실하게 알 수 있다. kernel에서 직접 그 프로세스에 어떤 ulimit이 적용되었는지 확인하는 방법이다.

그래서 /etc/sysconfig/docker 파일을 만들고 아래를 추가한다.

#-*- coding:utf-8 -*-
__author__ = 'saladaqoo'
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import argparse
import textwrap
import sys
public static class AotSafeExtensions
{
// こんなメソッドを用意しておくと
public static IEnumerable<T> AsSafeEnumerable<T>(this IEnumerable<T> source)
{
var e = ((IEnumerable)source).GetEnumerator();
using (e as IDisposable)
{
while (e.MoveNext())
{
/* patch suggestion writing after these line of https://github.com/git/git/blob/398dd4bd039680ba98497fbedffa415a43583c16/gettext.c#L1521 */
const char *git_setlocale(int category, const char* locale)
{
retval = setlocale(category, locale);
if (retval && *retval &&
strcmp(retval, "C") &&
strcmp(retval, "POSIX"))
return retval;
}