Skip to content

Instantly share code, notes, and snippets.

@ra2003
ra2003 / ANSI.md
Created August 6, 2022 20:33 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ra2003
ra2003 / wx_Python_SQLite3_Demo.py
Created March 27, 2022 13:05 — forked from dbh4ck/wx_Python_SQLite3_Demo.py
wxPython Sqlite3 Insert Update Delete
#---------------------------------------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- SQLITE3 GUI DEMO APP -*-
# -*- Python (2.7.11) -*-
# -*- wxPython (2.8) -*-
# -*- Author : DB <[email protected]> aka <db~@NC> -*-
# -*- GUI wxPython -*-
# -*- coded by db~@NC -*-
@ra2003
ra2003 / text_editor_wxWidgets
Last active March 26, 2022 14:47 — forked from 8785496/text_editor_wxWidgets
Text editor wxWidgets
// Main.cpp
#include <wx/wx.h>
#include "App.h"
IMPLEMENT_APP(App)
// App.h
#include <wx/wx.h>
#include "Frame.h"
@ra2003
ra2003 / visitor.py
Created March 21, 2022 19:28 — forked from devdave/visitor.py
Pynarcissus visitor like parser
from pynarcissus import jsparser
from collections import defaultdict
class Visitor(object):
CHILD_ATTRS = ['thenPart', 'elsePart', 'expression', 'body', 'initializer']
def __init__(self, filepath):
self.filepath = filepath
#List of functions by line # and set of names
@ra2003
ra2003 / postgres-cheatsheet.md
Created March 20, 2022 20:59 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ra2003
ra2003 / jagHook.asm
Created March 15, 2022 15:34 — forked from churchofthought/jagHook.asm
x86 Hooking Library written in MASM
comment *==========================================
jagHook by jAgx
Note that:
macros are like win32 api; they may modify all registers but ebx, edi, esi
your .text section needs to be writable if using the non-procedural hooking
if using radasm, add /SECTION:.text|RWE the LINK box under Project -> Project Options]
otherwise, just add /SECTION:.text,RWE to linking arguments
@ra2003
ra2003 / main.cpp
Created February 13, 2022 18:03 — forked from hasherezade/main.cpp
A native way to enumerate processes (alternative to: EnumProcesses, CreateToolhelp32Snapshot - Process32First - Process32Next)
#include <windows.h>
#include <iostream>
#include "ntddk.h"
bool enum_processes()
{
ULONG retLen = 0;
// check length:
@ra2003
ra2003 / EnumPTW.cs
Created January 9, 2022 17:15 — forked from meklarian/EnumPTW.cs
Enumerates Top-Level Windows, Processes, Thread Ids
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Diagnostics;
namespace EnumPTW
{
@ra2003
ra2003 / Resolve-KnownFolderGUID
Created January 8, 2022 22:07 — forked from davehull/Resolve-KnownFolderGUID
Need to resolve a Windows "known folder guid" to it's human-readable value?
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$GUID
)
function Resolve-KnownFolderGuid {
Param(
[Parameter(Mandatory=$True,Position=0)]
[String]$GUID