I hereby claim:
- I am plesiv on github.
- I am plesiv (https://keybase.io/plesiv) on keybase.
- I have a public key ASCafFXVuY8ql4bpuvmReKoh6B7jcK9uu7VLICWoG8TMkgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# normalize string given as an argument | |
n() { sed -e 's/^[ -]\+//' -e 's/[ -]\+$//' -e 's/[ ()-]\+/-/g' -e "s/'//g" | tr '[:upper:]' '[:lower:]' $1; } | |
# normalize name of the single file (renames file) | |
m() { mv "$1" "$(echo $1 | n)"; } | |
# normalize names of all files in the current directory | |
f() { for i in *; do m "$i"; done; } |
# save all tagged Docker images in the current directory | |
svimgs() { local image_ids=$(docker images | tail -n+2 | awk '{print $1 ":" $2}'); for id in $image_ids; do cdir=$(dirname $id); mkdir -p $cdir; docker save -o $id $id; done } | |
# load in Docker all images from the current directory | |
ldimgs() { local image_files=$(find -type f); for file in $image_files; do docker load --input $file; done } | |
# remove all images from Docker | |
rmimgs() { docker rmi -f $(docker images | tail -n+2 | awk '{print $3}' | sort -u); } | |
# clean <none> images | |
cleanimgs() { docker rmi -f $(docker images | grep '<none>' | awk '{print $3}' | sort -u); } | |
# kill all containers |
mkdir /mnt/gentoo | |
mount /dev/sda4 /mnt/gentoo | |
mount /dev/sda2 /mnt/gentoo/boot/ | |
mount -t proc proc /mnt/gentoo/proc/ | |
mount --rbind /sys /mnt/gentoo/sys | |
mount --make-rslave /mnt/gentoo/sys | |
mount --rbind /dev /mnt/gentoo/dev | |
mount --make-rslave /mnt/gentoo/dev/ |
/* | |
ID: dnkihot1 | |
LANG: C++ | |
TASK: combo | |
*/ | |
#include <iostream> | |
#include <fstream> | |
#include <set> | |
using namespace std; |
Debugging embedded system over ethernet with GDB (and gdbserver) | |
Prerequisite: host and target should be connected over network. | |
I - on target | |
* needed: | |
- compiled program that needs to be debugged (doesn't need | |
debugging symbols in it), | |
- gdbserver executable |
# Configuration | |
BIN_NAME := app_bin.elf | |
SRC_PATH := src | |
INC_PATH := include | |
LIB_PATH := lib | |
BUILD_PATH := build | |
CC := gcc | |
CFLAGS := -Wall -O0 -g3 | |
LDFLAGS := |
#!/usr/bin/env sh | |
# source: http://askubuntu.com/questions/194705/how-do-i-get-a-usb-drive-shortcut-on-desktop | |
# Show volumes on desktop | |
gsettings set org.gnome.nautilus.desktop volumes-visible true | |
# Don't auto-open mounted volumes | |
gsettings set org.gnome.desktop.media-handling automount-open false |
#!/usr/bin/env bash | |
# | |
# Installs Kernel modules on ramdisk and/or creates uramdisk from ramdisk. | |
# | |
# Tested on Ubuntu. | |
# Invoking with arguments: | |
# -m > install kernel modules on ramdisk | |
# -u > create uramdisk from ramdisk | |
# -mu / no arguments > do both |
#!/usr/bin/env python | |
""" | |
Configurable password generator | |
Usage instructions: | |
1. Configure generator by modifying values below | |
2. Execute script | |
""" | |
from random import shuffle |