Skip to content

Instantly share code, notes, and snippets.

View C1tas's full-sized avatar
👴
Focusing

C1tas

👴
Focusing
View GitHub Profile
@darwin
darwin / 1_unexpected.txt
Last active February 14, 2023 13:27
TotalFinder: `csrutil enable --without debug --without fs` no longer works as expected under macOS 11.x
# in recovery mode
❯ csrutil enable --without debug
# note that prior macOS 11.0 this would disable "Debugging Restrictions"
# since macOS 11.0 it seems to be disabling "Apple Internal" and "Filesystem Protections"
❯ csrutil status
System Integrity Protection status: unknown (Custom Configuration).
Configuration:
@AllenDang
AllenDang / gccemacs.md
Last active July 7, 2024 09:42
Build gccemacs on MacOS catalina with gcc 10 installed by homebrew.
@mikroskeem
mikroskeem / gccemacs_osx.md
Last active July 7, 2024 09:37
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

#!/usr/bin/env python
# Based on https://www.openwall.com/lists/oss-security/2018/08/16/1
# untested CVE-2018-10933
import sys, paramiko
import logging
username = sys.argv[1]
hostname = sys.argv[2]
command = sys.argv[3]
@zznop
zznop / mem-loader.asm
Last active March 6, 2023 00:17
Fun little loader shellcode that executes an ELF in-memory using an anonymous file descriptor (inspired by https://x-c3ll.github.io/posts/fileless-memfd_create/)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Copyright (C), zznop, brandonkmiller@protonmail.com
;;;
;;; This software may be modified and distributed under the terms
;;; of the MIT license. See the LICENSE file for details.
;;;
;;; DESCRIPTION
;;;
;;; This PoC shellcode is meant to be compiled as a blob and prepended to a ELF
@StoneMoe
StoneMoe / eventlet_patcher.py
Created March 7, 2018 11:33
Monkey patch for eventlet wsgi environ string bug
def eventlet_patcher():
# Ref: https://github.com/eventlet/eventlet/pull/467
# Ref: https://github.com/eventlet/eventlet/issues/468
from eventlet.wsgi import HttpProtocol
def new_get_environ(self):
env = self.server.get_environ()
env['REQUEST_METHOD'] = self.command
env['SCRIPT_NAME'] = ''
@2E0PGS
2E0PGS / vmware-workstation-khugepaged-fix.md
Last active May 29, 2024 13:55
Fixing khugepaged CPU usage VMware Workstation

If you run VMware Workstation 11 or above you may encounter high CPU usage from process khugepaged on Ubuntu 15.04+

The fix is to disable transparent hugepages. It seems Ubuntu has it enabled by default.

You can check the current status on your system by running:

cat /sys/kernel/mm/transparent_hugepage/enabled

cat /sys/kernel/mm/transparent_hugepage/defrag

@longforfreedom
longforfreedom / gist:5d5f9fef1411921ff6be9880bcf5926c
Created December 7, 2017 06:21
调用IDEA反编译整个Jar包
## 调用IDEA反编译整个Jar包
IDEA的反编译插件<https://github.com/JetBrains/intellij-community/tree/master/plugins/java-decompiler>没有在界面上没有提供一次反编译整个Jar包的功能,但可以通过他在命令行中调用他的工具类来反编译整个Jar包调用IDEA的安装目录的"plugins\java-decompiler\lib\java-decompiler.jar"的*org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler*便可实现.
例如`java -cp "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true dacp-dp-executor-steps-guizhou-0.0.1-SNAPSHOT.jar mysrc`
mysrc目录下会有生成的整个Jar包的源文件(打成了jar,用zip解压即可)其实是用fernflower<https://github.com/fesh0r/fernflower>实现的
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active July 14, 2024 18:27
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@lpimem
lpimem / aria2c.py
Last active December 25, 2023 21:12
Aria2 Python Client
import json
import requests
class Aria2c:
'''
Example :
client = Aria2c('localhost', '6800')
# print server version