Skip to content

Instantly share code, notes, and snippets.

View Luavis's full-sized avatar
🐈
meow~

Luavis Luavis

🐈
meow~
View GitHub Profile
@Luavis
Luavis / RSA.php
Last active December 23, 2015 15:19
RSA.php
<?php
$privateKeyPassphrase = "PASSWORD";
$privateKeyString = <<<PK
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,462A3423852255C0
-----END RSA PRIVATE KEY-----
PK;
@Luavis
Luavis / .gitignore
Last active February 26, 2016 08:56
default .gitignore
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.log
Doxyfile
@Luavis
Luavis / .vimrc
Last active December 27, 2015 01:09
.vimrc
set autoindent
set cindent
set smartindent
set textwidth=79
set wrap
set nowrapscan
set nobackup
set visualbell
set ruler
set tabstop=3
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
#!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools, set a download
We can't make this file beautiful and searchable because it's too large.
"1.0.0.0","1.0.0.255","16777216","16777471","AU","Australia"
"1.0.1.0","1.0.3.255","16777472","16778239","CN","China"
"1.0.4.0","1.0.7.255","16778240","16779263","AU","Australia"
"1.0.8.0","1.0.15.255","16779264","16781311","CN","China"
"1.0.16.0","1.0.31.255","16781312","16785407","JP","Japan"
"1.0.32.0","1.0.63.255","16785408","16793599","CN","China"
"1.0.64.0","1.0.127.255","16793600","16809983","JP","Japan"
"1.0.128.0","1.0.255.255","16809984","16842751","TH","Thailand"
"1.1.0.0","1.1.0.255","16842752","16843007","CN","China"
"1.1.1.0","1.1.1.255","16843008","16843263","AU","Australia"
#!/bin/bash
DATA=./GeoIPCountryWhois.csv
IPT=/sbin/iptables
for IPRANGE in `egrep "China" $DATA | cut -d, -f1,2 | sed -e 's/"//g' | sed -e 's/,/-/g'`
do
$IPT -A INPUT -p all -m iprange --src-range $IPRANGE -j DROP
done
#!/bin/sh
echo "Certification password:"
read -s password
read -p "Domain(www.xxx.xxx): `echo $'\n> '`" domain
read -p "Country(KR, US): `echo $'\n> '`" country
read -p "State/Province: `echo $'\n> '`" state
read -p "City: `echo $'\n> '`" city
read -p "Organization: `echo $'\n> '`" org
read -p "Team: `echo $'\n> '`" team
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;
@Luavis
Luavis / jumin.js
Created March 26, 2014 14:28
대한민국 주민번호 확인 알고리즘
"use strict";
var input = '13자리의 주민번호 - 없이';
var mul = [2,3,4,5,6,7,8,9,2,3,4,5];
var sum = 0;
for(var i =0; i < mul.length; i++) {
var digit = parseInt(input[i]);
sum += digit * mul[i];
}