Skip to content

Instantly share code, notes, and snippets.

Sergey Karatkevich kevit

Block or report user

Report or block kevit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gilbarbara
gilbarbara / gitsubmodules.sh
Last active Nov 28, 2019
Install git submodules from a .gitmodules file
View gitsubmodules.sh
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@cecilemuller
cecilemuller / readme.md
Last active Jan 29, 2016
Let's encrypt (Nginx, Ubuntu 14.04 LTS)
View readme.md

Install the client:

apt-get install git
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Generate certificates using manual mode:

@dcode
dcode / ol7_addons.repo.sh
Last active Jan 8, 2019
Enable the OL7 Add-ons repo. Includes virtualbox, docker, R, and others.
View ol7_addons.repo.sh
cat << EOF | sudo tee /etc/yum.repos.d/ol7_addons.repo
[ol7_addons]
name=Oracle Linux $releasever Add ons (\$basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
# Verify this manually if you're paranoid like me
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Created Aug 8, 2015
Disable vim automatic visual mode on mouse select
View disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active Dec 10, 2019
MDADM and LVM cheat sheet
View gist:52ecc9f18efb32c68d18

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
View Port Knocking with Scapy Example
#!/usr/bin/python
"""
Port Knocking with scapy example.
Knock on port 42304
Knock on port 53768
Knock on port 3297
HTTP request to port 19760
Now, to get the flag, we just need to write a small scrip to implement all this logic. We will use the scapy python library to perform the port knocking and curl for the HTTP request part:
@Liryna
Liryna / ARMDebianUbuntu.md
Last active Dec 13, 2019
Emulating ARM on Debian/Ubuntu
View ARMDebianUbuntu.md

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

@d11wtq
d11wtq / docker-ssh-forward.bash
Created Jan 29, 2014
How to SSH agent forward into a docker container
View docker-ssh-forward.bash
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@pkuczynski
pkuczynski / parse_yaml.sh
Last active Dec 11, 2019
Read YAML file from Bash script
View parse_yaml.sh
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
You can’t perform that action at this time.