Skip to content

Instantly share code, notes, and snippets.

View jeongm-in's full-sized avatar
🥦

Jeong Min Lim jeongm-in

🥦
View GitHub Profile
@jeongm-in
jeongm-in / keymap.c
Created April 3, 2021 21:42
gaslight keymap
/* Copyright 2021 Jeong Min Lim <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
def print_list(list):
# check for empty list
if not list:
print("")
return
print(list[0], end="")
if len(list) > 1:
for index, item in enumerate(list[1:-1]):
@jeongm-in
jeongm-in / keybindings.json
Last active March 29, 2020 07:39 — forked from Bartleby2718/VSCode modified.xml
Shamelessly piggybacking on @Bartleby2718's VSCode Shortcut Customization
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+y",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+z",
"command": "redo",
@jeongm-in
jeongm-in / notable stuff.md
Last active February 11, 2020 21:11
neverlan ctf 2020 - revseng

main

0000000000001145 <main>:
    1145:	55                   	push   %rbp
    1146:	48 89 e5             	mov    %rsp,%rbp
    1149:	48 83 ec 20          	sub    $0x20,%rsp
    114d:	89 7d ec             	mov    %edi,-0x14(%rbp)
    1150:	48 89 75 e0          	mov    %rsi,-0x20(%rbp)
    1154:	c7 45 fc 79 00 00 00 	movl   $0x79,-0x4(%rbp)
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Seh
include Msf::Exploit::Remote::HttpServer::HTML
@jeongm-in
jeongm-in / chocolatey-master-install.bat
Last active September 19, 2019 00:47
Automate installing software after fresh start
:: Chocolatey install script
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install all the packages in packages.txt
for /F "eol=#" %%G in (packages.txt) do choco install %%G -fy
@jeongm-in
jeongm-in / curl.md
Created August 7, 2019 15:23 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jeongm-in
jeongm-in / git.md
Created August 2, 2019 15:58 — forked from Bartleby2718/git.md
git commands I don't want to forget

mostly the ones that are not supported by GitHub Desktop, not in the order of StackOverflow votes

  • git rm -r --cached .: stop tracking all files that are already tracked because .gitignore is not applied to those files (source)
  • git log --graph --decorate --oneline: visualize branch topology (source)
  • git commit --amend --no-edit: modify a commit without changing the commit message (source)
  • git reset --soft HEAD~3: undo the last 3 commits but keep the files (so that you can squash the commits) (source)
  • git stash

Ubuntu on Azure (VS AWS)

  • Azure lets me add ssh key pair on initialization, while AWS gives me a .pem file.
  • So I was able to ssh into my Azure instance rightaway, without setting up putty or key or anything.
  • This time I configured Ubuntu as my web server insted of using AMI.
  • All packages were up-to-date.
  • Username was what I set when initializing the instance, I just set a new password.
  • Root is still accessible.
  • sudo apt install build-essential to install necessary development related tools.
  • curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - and then sudo apt-get install -y nodejs to install node
@jeongm-in
jeongm-in / OJ_text_input_example.md
Last active June 12, 2019 12:13
How to get test cases through text file input for *most* Online Judges
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    //code here

 return 0;