Skip to content

Instantly share code, notes, and snippets.

View D4rk4's full-sized avatar
🏠
Working from home

Dmitry Galenko D4rk4

🏠
Working from home
View GitHub Profile
@D4rk4
D4rk4 / redmine-install.sh
Last active July 2, 2018 14:01
Install Redmine on Debian 9
#!/bin/sh
set -e
[ -z "${MYSQL_PASSWD}" ] && MYSQL_PASSWD=mysqlpwd
[ -z "${REDMINE_PASSWD}" ] && REDMINE_PASSWD=redmineadm
mysql_install()
{
cat <<EOF | sudo debconf-set-selections
@D4rk4
D4rk4 / mass-lock-users.sh
Created January 11, 2019 11:14
Lock users in all AWS accounts, when they left our company
#!/bin/bash
# Author: [email protected]
#
# Use SecurityMonkey for find all logins
# Plz put users logins into this list ---v
input='/opt/scripts/aws/aws-users-lock.list'
lock_user () {
echo -en "[${profile} - ${user}]\t"
echo -en "removing login progile, "
@D4rk4
D4rk4 / mass-create-users.sh
Created January 11, 2019 11:17
Just create users in AWS IAM from file (random one time passwords)
#!/bin/bash
delim='---------CUTH HERE---------'
input='/opt/scripts/aws/aws-users.list'
create_user () {
profile=$1
user=$2
fxsdpolicy=$3
pass=`strings /dev/urandom|grep -o '[[:alnum:]]'|head -n 16|tr -d '\n'|sed 's/^/!/;s/$/6/'`
####
@D4rk4
D4rk4 / kmskeys10.txt
Last active July 11, 2021 17:28 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
Error
“Error: 0xC004F069 On a computer running Microsoft Windows non-core edition, run ‘slui.exe 0x2a 0xC004F069’ to display the error text”
Solution
Find available target editions
DISM.exe /Online /Get-TargetEditions
A. Create Installation DVD ISO Via Dism:
1. Extract Win 10 Enterprise version of the mirror sources folder install.wim to D drive temp directory
2. In the temp directory to create WimMount folder, and execute the following command to mount the wim file
Dism /Mount-Wim /WimFile:D:\temp\install.wim /Index:1 /MountDir:D:\temp\WimMount
3. Show the current version
Dism /Image:D:\temp\WimMount /Get-CurrentEdition
4. Show current version
Dism /Image:D:\temp\WimMount /Get-TargetEditions
@D4rk4
D4rk4 / pwn-h0tb0x.sh
Last active May 19, 2019 20:59
Usage: pwn-h0tb0x.sh /path/to/pmkid_HOTBOXABCD_6C-2E-85-FE-BE-AA_2029-03-07T10-47-49.16800
#!/bin/bash
nethex=`echo ${1}|cut -f2 -d_|sed 's/HOTBOX//'|tr '[:upper:]' '[:lower:]'`
dict='/tmp/hothex.dict'
append_hex () {
while read pref
do
from=00 to=ff
if test "${#from}" -gt "${#to}"; then
format="$pref%0${#from}x$nethex\n"
@D4rk4
D4rk4 / 99-keepwanalive
Last active May 22, 2019 21:15 — forked from navhaxs/99-keepwanalive
openwrt wan auto reconnect hotplug script
#!/bin/bash
# Place me in /etc/hotplug.d/iface/99-keepwanalive
IFNAME='wlan0'
if [ "$ACTION" = "ifdown" -a "$INTERFACE" = "$IFNAME" ]; then
COUNTER=0
PASS=0
while [ $PASS -eq 0 ]
@D4rk4
D4rk4 / ton-install.sh
Last active September 15, 2019 12:32
TON full node installation script for Debian 10
#!/bin/bash
export DEBCONF_FRONTEND=noninteractive
apt-get -y purge console-setup
apt-get update
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" install -yq libghc-zlib-dev gperf build-essential make wget libreadline-dev git ccache libmicrohttpd-dev libssl-dev cmake libgflags-dev --allow-downgrades --allow-remove-essential --allow-change-held-packages
apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" dist-upgrade -yq
cd /usr/src
git clone --recurse-submodules -j8 https://github.com/ton-blockchain/ton
mkdir /tmp/ton-build
cd /tmp/ton-build
@D4rk4
D4rk4 / gist:a95e90e7db26bec58ac12d4a69d1e78e
Created October 5, 2019 11:44 — forked from andrewlkho/gist:3d05108ddb363243198d93526980522e
Expanding storage on a Raspberry Pi using Amazon S3

I've been playing around with a Raspberry Pi hosted with Mythic Beasts and wanted a way to keep a large number of infrequently-accessed files on the server. A cost-effective place to store such data is on Amazon S3. After looking around at ways to mount an S3 bucket on the Raspberry Pi and have it appear as a regular filesystem, I came across s3backer. This provides a single file, divided into blocks, each of which is stored as an S3 object. A filesystem is mounted onto this file using a loopback mount. This setup has many benefits which are explained well in the README. Here's how to set it up on the Raspberry Pi.

I'm going to assume that you have an S3 bucket mybucket created and a user with credentials to access it. Although not explicitly specified, some of the commands below need to be run as root.

First, install prerequisites (the first line is

### Keyboard config
d-i debian-installer/locale string en_US.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
d-i keyboard-configuration/xkb-keymap us
d-i keyboard-configuration/xkb-keymap select us
d-i keyboard-configuration/toggle select No toggling
d-i keyboard-configuration/variantcode string American English
### Network configuration