Skip to content

Instantly share code, notes, and snippets.

#filter-file-system-call ,
strace -Tfe trace=open,read,write ./program
#follow-redirect , auto-redirect ,
curl -L example.com
@creative-sensor
creative-sensor / linux.notes
Last active May 7, 2018 23:33
Linux admin cheatsheet
#!/bin/sh
# nmcli , set-ip-address ,
nmcli c modify eth0 ipv4.method static ipv4.addresses 192.168.1.15/24 ipv4.dns 8.8.8.8 ipv4.gateway 192.168.1.1 connection.autoconnect yes
nmcli con down eth0
nmcli con up eth0
# bond-rr ,
nmcli con add type bond ifname BOND_RR
#!/bin/bash
####################### ORACLE NOTES ###################################
## Use Vim:searchIndex() to search index ##
## Ex: searchIndex list tablespace ##
########################################################################
#tablespace , tablespace-management ,
@creative-sensor
creative-sensor / ssh
Last active September 17, 2017 07:52
# Reversed ssh: acts like trojan that open backdoor behind firewall by tunneling
1/ Confined host (behind firewall) ------ ssh tunnel XYZ -----> freedom host:22
2/ Confined host (localhost:22) <----- ssh forward inside tunnel XYZ --------- freedom host (localhost:11111) <---- ssh --- User
Run this command from confined host:
ssh -R localhost:11111:localhost:22 username@freedom_host
@creative-sensor
creative-sensor / notes
Last active April 20, 2018 07:06
tips and tricks
# match repeated characters "(aaa)baa(bbb)cdd
echo aaabaabbbcdd | grep -E '(.)\1\1' -
# python , print-json-pretty ,
echo '{1.2:3.4}' | python -mjson.tool
@creative-sensor
creative-sensor / ipush
Created February 21, 2017 15:59
Push file data through long ssh pipe
#!/bin/bash -x
SRC=$1
DST=$2
DEV="hostname of intermediary"
PI=$(<~/.pi)
ssh_dev="ssh -A $DEV"
ssh_dump_pi="ssh $PI 'sudo bash -c \"cat > "$DST"\"'"
@creative-sensor
creative-sensor / list.h
Created November 3, 2016 22:28
Kernel linked list for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <linux/types.h>
//#include <linux/stddef.h>
//#include <linux/poison.h>
//#include <linux/const.h>
//#include <linux/kernel.h>
#include <unistd.h>
/*
@creative-sensor
creative-sensor / no_module_version_check.config
Created October 26, 2016 15:39
Build kernel with this config file will allow module not having to be checked version before loading every new build version of module. No need to rebuild entire kernel anymore everytime change applied only to one module only.
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.18.31 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_PERF_EVENTS_INTEL_UNCORE=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
set laststatus=2
set ruler
set cursorline
set hlsearch
set nowrap
set expandtab
set tabstop=4
set mouse=a
filetype plugin on