Skip to content

Instantly share code, notes, and snippets.

View bongbongco's full-sized avatar

LeeSeungyong bongbongco

View GitHub Profile
@bongbongco
bongbongco / Socket.class
Created August 25, 2016 02:48
C# Port Forwarding
using System;
using System.Net;
using System.Net.Sockets;
namespace BrunoGarcia.Net
{
public class TcpForwarderSlim
{
private readonly Socket _mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
@bongbongco
bongbongco / README.md
Created April 19, 2022 05:48 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@bongbongco
bongbongco / scheduler.py
Created October 7, 2016 03:31
파이썬 스케줄러 만들기
from apscheduler.jobstores.base import JobLookupError
from apscheduler.schedulers.background import BackgroundScheduler
import time
class Scheduler(object):
# 클래스 생성시 스케쥴러 데몬을 생성합니다.
def __init__(self):
self.sched = BackgroundScheduler()
self.sched.start()
@bongbongco
bongbongco / PingChecker.py
Created March 29, 2019 01:50
파이썬을 활용한 다량 호스트 ICMP 확인 스크립트(대상목록: target.txt, 결과목록: result.txt)
# works under Linux, Mac OS, Windows
import subprocess, platform
from time import sleep
def ping(host):
"""
Returns True if host responds to a ping request
"""
// 소스출처 : http://www.kma.go.kr/weather/forecast/digital_forecast.jsp 내부에 있음
// 기상청에서 이걸 왜 공식적으로 공개하지 않을까?
//
// (사용 예)
// var rs = dfs_xy_conv("toLL","60","127");
// console.log(rs.lat, rs.lng);
//
<script language="javascript">
//<!--
var BASE64_MARKER = ';base64,';
const convertDataURIToBinary = dataURI => {
var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length;
var base64 = dataURI.substring(base64Index);
var raw = window.atob(base64);
var rawLength = raw.length;
var array = new Uint8Array(new ArrayBuffer(rawLength));
for(i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i);
@bongbongco
bongbongco / VerifiedHttpClient.java
Created June 28, 2018 08:26 — forked from mrworf/VerifiedHttpClient.java
Android HttpClient with cert pinning
/**
* Copyright 2016 Henric Andersson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
input {
tcp {
port => 5000
type => syslog
}
udp {
port => 5000
type => syslog
}
}
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@bongbongco
bongbongco / CVE-2018-6389.sh
Created February 12, 2018 00:42
patch for DoS vulenrability (CVE-2018-6389)
if [[ -f wp-login.php && -f wp-admin/load-scripts.php && -f wp-admin/includes/noop.php ]]
then
sed -i "1 s/^.*$/<?php\ndefine('CONCATENATE_SCRIPTS', false);/" wp-login.php
sed -i -e "s/^require( ABSPATH . WPINC . '\/script-loader.php' );$/require( ABSPATH . 'wp-admin\/admin.php' );/g" wp-admin/load-scripts.php
sed -i -e "s/^require( ABSPATH . WPINC . '\/script-loader.php' );$/require( ABSPATH . 'wp-admin\/admin.php' );/g" wp-admin/load-styles.php
echo """<?php
/**
* Noop functions for load-scripts.php and load-styles.php.
*
* @package WordPress