Skip to content

Instantly share code, notes, and snippets.

View gnh1201's full-sized avatar
🍉
Your Watermelon OPEN UP!

Namhyeon, Go gnh1201

🍉
Your Watermelon OPEN UP!
View GitHub Profile
@gnh1201
gnh1201 / 0_reuse_code.js
Created August 30, 2016 11:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gnh1201
gnh1201 / create-mysql.bash
Last active March 9, 2018 04:39 — forked from omeinusch/create-mysql.bash
Simple bash script to create mysql db, user with generated password
#!/bin/bash
PASS=`pwgen -s 40 1`
mysql -uroot <<MYSQL_SCRIPT
CREATE DATABASE $1 default character set utf8 COLLATE utf8_general_ci;
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost';
FLUSH PRIVILEGES;
MYSQL_SCRIPT
@gnh1201
gnh1201 / debug.c
Created October 23, 2019 15:03 — forked from Nordwald/debug.c
Code Injection
/*
* Gets Thread token for current thread.
* Returns NULL on failure.
*/
HANDLE GetCurrentThreadToken()
{
HANDLE hToken;
if (!OpenThreadToken(
@gnh1201
gnh1201 / process_hollowing.c
Created October 23, 2019 15:28 — forked from itsff/process_hollowing.c
A pretty neat exploit called Process Hollowing. You start a process suspended, then replace its content with the content of another.
#include <stdio.h>
#include <Windows.h>
#include <winternl.h>
#pragma comment(lib,"ntdll.lib")
EXTERN_C NTSTATUS NTAPI NtTerminateProcess(HANDLE,NTSTATUS);
EXTERN_C NTSTATUS NTAPI NtReadVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE,PVOID,PVOID,ULONG,PULONG);
EXTERN_C NTSTATUS NTAPI NtGetContextThread(HANDLE,PCONTEXT);
@gnh1201
gnh1201 / install-ssl-apache.md
Created April 10, 2020 01:12 — forked from ccschmitz/install-ssl-apache.md
How to install an SSL certificate on an Apache server.

Installing an SSL certificate on Apache

  1. Create a private key:
openssl genrsa 2048 > private-key.pem
  1. Create a Certificate Signing Request (CSR):
@gnh1201
gnh1201 / COMODO PositiveSSL certificate.md
Created April 10, 2020 01:20 — forked from kktuax/COMODO PositiveSSL certificate.md
SSL instructions for Apache HTTP Server

Input files for domain mydomain.es

-rw-r--r-- 1 www-data www-data 1,5K 2014-07-09 18:26 AddTrustExternalCARoot.crt
-rw-r--r-- 1 www-data www-data 2,0K 2014-07-09 18:26 COMODORSAAddTrustCA.crt
-rw-r--r-- 1 www-data www-data 2,2K 2014-07-09 18:26 COMODORSADomainValidationSecureServerCA.crt
-rw-r--r-- 1 www-data www-data 1,9K 2014-07-09 18:26 mydomain_es.crt
-rw-r--r-- 1 www-data www-data 1,1K 2014-07-09 17:48 mydomain_es.csr
-rw-r--r-- 1 www-data www-data 1,7K 2014-07-09 17:48 mydomain_es.key
@gnh1201
gnh1201 / crc16.c
Created January 22, 2021 08:40 — forked from tijnkooijmans/crc16.c
CRC-16/CCITT-FALSE
uint16_t crc16(char* pData, int length)
{
uint8_t i;
uint16_t wCrc = 0xffff;
while (length--) {
wCrc ^= *(unsigned char *)pData++ << 8;
for (i=0; i < 8; i++)
wCrc = wCrc & 0x8000 ? (wCrc << 1) ^ 0x1021 : wCrc << 1;
}
return wCrc & 0xffff;
@gnh1201
gnh1201 / obs_twitch_chat.css
Created April 1, 2022 09:25 — forked from Bluscream/obs_twitch_chat.css
Twitch chat transparent popout for OBS
/*
Twitch chat browsersource CSS for OBS
Just set the URL as https://www.twitch.tv/%%TWITCHCHANNEL%%/chat?popout=true
And paste this entire file into the CSS box
Original by twitch.tv/starvingpoet modified by github.com/Bluscream
General Settings
*/
body {
color: #FFFFFF!important;
@gnh1201
gnh1201 / set-up-chromium-keys.md
Last active August 30, 2022 11:17 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the [email protected] mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur