Skip to content

Instantly share code, notes, and snippets.

View Frodox's full-sized avatar
🎯
Focusing

Vitaly Rybnikov Frodox

🎯
Focusing
View GitHub Profile
@Frodox
Frodox / gist:6e2d62e65660a4fa0c34
Created December 11, 2014 11:11
parallel commands with xargs
xargs < Makefile -P $(nproc) -I{} echo -e "{}\n"
@Frodox
Frodox / get-ip-of-virtualbox-vm.sh
Last active February 18, 2020 20:27
How to know IP of VM in VirtualBox
#!/bin/bash
VBoxManage list runningvms
VBoxManage guestproperty get "VM_NAME" "/VirtualBox/GuestInfo/Net/0/V4/IP"
# NOTE: work only if guest vm have VboxAdditions installed
@Frodox
Frodox / time.md
Last active August 29, 2015 14:13 — forked from linse/time.md

The Unix time command

man time is a good start - on Linux you get the GNU time version.

Note: some shells (e.g.,bash(1)) have a built-in time command that provides less functionality than the command described here. To access the real command, you may need to specify its pathname (something like /usr/bin/time).

GNU time

A call of /usr/bin/time gives a lot of information:

/usr/bin/time ls > /dev/null
@Frodox
Frodox / git-pre-receive-hook.sh
Last active August 29, 2015 14:25 — forked from caniszczyk/git-pre-receive-hook.sh
A reasonable git pre-receive-hook
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.
@Frodox
Frodox / pygtk-screenshot.py
Last active August 29, 2015 14:26
Taking a screenshot of the active window with using pygtk
#!/usr/bin/env python
#http://faq.pygtk.org/index.py?req=show&file=faq23.039.htp
try :
import gtk.gdk
except ImportError :
print 'You need to install pygtk'
exit(1)
# Geany's snippets configuration file
#
# use \n or %newline% for a new line (it will be replaced by the used EOL char(s) - LF, CR/LF, CR).
# use \t or %ws% for an indentation step, it will be replaced according to the current document's indent mode.
# use \s to force whitespace at beginning or end of a value ('key= value' won't work, use 'key=\svalue').
# use %key% for all keys defined in the [Special] section.
# use %cursor% to define where the cursor should be placed after completion. You can define multiple
# %cursor% wildcards and use the "Move cursor in snippet" to jump to the next defined cursor
# position in the completed snippet.
# You can define a section for each supported filetype to overwrite default settings, the section
@Frodox
Frodox / fix-double-border-gtk2.md
Last active March 30, 2016 09:35
fox double border

Had the same problem with gtk3/compton/i3. Using i3 4.8-3, gtk3 3.14.9-1, compton v0.1_beta2-5 on Arch. The other fixes suggested here didn't work for me.

The following fixed the problem for me:

You need to edit the file ~/.config/gtk-3.0/gtk.css

.window-frame, .window-frame:backdrop {
 box-shadow: 0 0 0 black;
 border-style: none;
 margin: 0;
#!/bin/bash
#
# PoC ssh-password cracker based on sshpass pkg.
# Run it like: echo 192.168.1.{1..254} | tr ' ' '\n' | xargs -P$(nproc) -I{} bash -c "./hack-pc.sh {} 123123 123 12345678"
#
#
IP="$1"
shift
PASSES="$@"
from buildbot.plugins import worker
WILY_WORKER_NAMES = ['wily-worker-{}'.format(i) for i in range(3)]
XENIAL_WORKER_NAMES = ['xenial-worker-{}'.format(i) for i in range(3)]
YAKKETY_WORKER_NAMES = ['yakkety-worker-{}'.format(i) for i in range(3)]
WORKERS = [
worker.DockerLatentWorker(
worker_name,
'SECRET',
@Frodox
Frodox / quick-start-iso.sh
Last active June 22, 2017 17:02
Quick start for creating custom centos like distro (gist for article ... )
cd /tmp
setenforce 0
LORAX_TMP_DIR=./lorax-raw # тут будут результаты его работы
lorax -p Fedora-Generic -v 22 -r 22 \
-s http://mirror.centos.org/centos-7/7/os/x86_64/ \
-s http://mirror.centos.org/centos-7/7/updates/x86_64/ "$LORAX_TMP_DIR"
...
buildroot=/build/lorax
mount -o loop,ro "$LORAX_TMP_DIR/images/boot.iso" "$TMP_MOUNT_DIR"
rm -rf "$buildroot"