Skip to content

Instantly share code, notes, and snippets.

View somma's full-sized avatar

somma somma

View GitHub Profile
+ create `/Users/somma/Library/KeyBindings/DefaultKeyBinding.dict` file with below contents, and reboot :D
{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
import json
from slacker import Slacker
from websocket import create_connection
slack = Slacker('xxxxxx')
# start RTM
rtm = slack.rtm.start()
url = rtm.body['url']
ws = create_connection(url)
@somma
somma / create_process_as_login_user.cpp
Last active August 27, 2022 15:32
create_process_as_login_user
bool
create_process_as_login_user(
_In_ const wchar_t* cmdline
)
{
_ASSERTE(NULL != cmdline);
if (NULL == cmdline) return false;
DWORD session_id = WTSGetActiveConsoleSessionId();
DWORD explorer_pid = 0xFFFFFFFF;
# set prefix
set -g prefix `
unbind C-b
bind ` send-prefix
 
# split pane
bind | split-window -h
bind - split-window -v
 
# move to pane
@somma
somma / stdafx.h
Created July 19, 2017 07:34
stdafx.h
/**
* @file AntiRanSomware user mode engine
* @brief
* @ref
* @author Yonhgwhan, Roh (fixbrain@gmail.com)
* @date 2017/01/21 created.
* @copyright All rights reserved by Yonghwan, Roh.
**/
#pragma once
@somma
somma / tiny_pe.asm
Created November 5, 2019 14:11
Very tiny program that prints the sum of 1 to 10.
;
; TinyPE.asm
;
BITS 32
; IMAGE_NT_HEADERS 의 시작 위치가 4 이어야 하므로 섹션/파일 얼라인먼트를 4 로.
; 공교롭게도 e_lfanew = 4 로 동일하게 맞아떨어짐
;
SectionAlignment equ 0x00000004