Skip to content

Instantly share code, notes, and snippets.

View Prototype-X's full-sized avatar

Maxim Prototype-X

View GitHub Profile
@Prototype-X
Prototype-X / passwd.yml
Created January 31, 2020 12:39 — forked from krushik/passwd.yml
ansible playbook to change user password on linux
---
# You may override default target user with -e user=someotheruser
# It is mandatory to choose a strong password! At least consult with https://www.bennish.net/password-strength-checker/
- name: change linux user password
hosts: [all]
gather_facts: no
vars_prompt:
## use this when 656K rounds will be OK for your servers' CPU performance, or when rounds number will become configurable in ansible
# You may need 'apt-get install python-passlib' or 'pip install passlib' for vars_prompt encryption
@Prototype-X
Prototype-X / compile-ffmpeg-nvenc.sh
Last active January 26, 2020 21:03
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#for ubuntu 19.04
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
@Prototype-X
Prototype-X / .tmux.conf
Created December 17, 2019 10:53 — forked from rodricels/.tmux.conf
tmux configuration, mouse copy & paste added
# My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf
# Scroll History
set -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# set first window to index 1 (not 0) to map more to the keyboard layout
set-option -g renumber-windows on
@Prototype-X
Prototype-X / tmux-cheatsheet.markdown
Created December 14, 2019 12:20 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Prototype-X
Prototype-X / tmux.md
Created December 14, 2019 12:19 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@Prototype-X
Prototype-X / noroot_tcpdump.sh
Created September 24, 2019 14:02
Enable tcpdump for non-root users on Debian/Ubuntu.
#!/usr/bin/env bash
# NOTE: This will let anyone who belongs to the 'pcap' group
# execute 'tcpdump'
# NOTE2: User running the script MUST be a sudoer. It is
# convenient to be able to sudo without a password.
sudo groupadd pcap
sudo usermod -a -G pcap $USER
@Prototype-X
Prototype-X / apt_pinning_priorities.md
Created April 16, 2019 13:06 — forked from JPvRiel/apt_pinning_priorities.md
Apt package pinning and priorities
@Prototype-X
Prototype-X / gist:db9a3c68d68b2639b74c9e424a2e9576
Last active April 9, 2019 08:07 — forked from MinaMikhailcom/gist:0825906230cbbe478faf4d08abe9d11a
Fix for "couldn't run /usr/bin/dumpcap in child process: permission denied"
sudo dpkg-reconfigure wireshark-common #Select "Yes"
chmod +x /usr/bin/dumpcap
sudo setcap 'CAP_NET_RAW+eip CAT_NET_ADMIN+eip' /usr/bin/dumpcap
or
`sudo setcap 'CAP_NET_RAW+eip CAT_NET_ADMIN+eip' $(which dumpcap)'
@Prototype-X
Prototype-X / ssh_tunnels.sh
Last active July 21, 2022 20:08 — forked from billautomata/ssh_tunnels.sh
ssh port forwarding cheatsheet
# local port forwarding
# the target host 192.168.0.100 is running a service on port 8888
# and you want that service available on the localhost port 7777
ssh -L 7777:localhost:8888 user@192.168.0.100
# remote port forwarding
# you are running a service on localhost port 9999
# and you want that service available on the target host 192.168.0.100 port 12340
@Prototype-X
Prototype-X / sysrq.md
Last active March 28, 2018 09:06
sysrq

Linux Magic System Request Key Hacks

Documentation for sysrq.c

What is the magic SysRq key?


It is a 'magical' key combo you can hit which the kernel will respond to
regardless of whatever else it is doing, unless it is completely locked up.