Skip to content

Instantly share code, notes, and snippets.

View arno01's full-sized avatar
🎯
Focusing

Andrey Arapov arno01

🎯
Focusing
View GitHub Profile
@arno01
arno01 / tox.sh
Last active August 29, 2015 14:00 — forked from notadecent/tox.sh
#!/bin/bash
## wget -O tox.sh waa.ai/iqt && chmod +x ./tox.sh && ./tox.sh
## ./tox.sh -sl to skip libsodium (they don't update that often)
## ./tox.sh -sd to skip libsodium and all the other dependencies
## If libraries are missing, remove /etc/ld.so.conf.d/locallib.conf and
## try running again. Else, try messing around with the prefix paths.
# Check if script is being ran as root
test "$(whoami)" == 'root' && (echo "Please don't run this script as root"; exit 1)
@arno01
arno01 / rsatest.py
Last active August 29, 2015 14:06
RSA Key Generation, Encryption and Decryption example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -------------------------------------
# RSA Key Generation, Encryption and Decryption example
# Copyright (C) 2014 Andrey Arapov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@arno01
arno01 / dhtest.py
Created September 12, 2014 09:11
Diffie-Hellman key exchange example in python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# -------------------------------------
# Diffie-Hellman key exchange example
# Copyright (C) 2014 Andrey Arapov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@arno01
arno01 / keybase.md
Created September 17, 2014 05:50
keybase proof

Keybase proof

I hereby claim:

  • I am arno01 on github.
  • I am andreyarapov (https://keybase.io/andreyarapov) on keybase.
  • I have a public key whose fingerprint is A025 3B65 7A7F 1D4C 3305 20F6 368D DA2E 9A47 1EAC

To claim this, I am signing this object:

@arno01
arno01 / git-cache-meta.sh
Created October 19, 2015 14:33
Simple file meta data caching and applying. Good alongside with git
#!/bin/sh -e
# git-cache-meta -- simple file meta data caching and applying.
# Simpler than etckeeper, metastore, setgitperms, etc.
# from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
# modified by n1k
# - save all files metadata not only from other users
# - save numeric uid and gid
# Changes by: Andrey Arapov <andrey.arapov@nixaid.com>
@arno01
arno01 / gist:535913090ffa65ce3dfaf67ac1e880d4
Created July 13, 2016 07:55
pulseaudio, deleted files in /dev/shm, grsecurity, etc...
Workaround: pulseaudio client library likes to remove /dev/shm/pulse-shm-*
files created by the host, causing sound to stop working.
To fix this, we either want to disable the shm or mount /dev/shm
in read-only mode when starting the container.
echo "enable-shm = no" |tee -a /etc/pulse/client.conf
Q: But why it works in chroot?
A: chroot does not create a new pid namespace.
However, when a client runs in a sandbox that creates a new pid namespace,
pa_shm_cleanup() will remove all shm files, because kill() fails with ESRCH.

Usage

curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
  sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@.service | \
  sudo tee /etc/systemd/system/autossh@.service

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
2018/10/08 11:40:22 [DEBUG] ReferenceTransformer: "data.vsphere_datacenter.dc" references: []
2018/10/08 11:40:22 [DEBUG] ReferenceTransformer: "data.vsphere_host.host" references: [data.vsphere_datacenter.dc]
2018/10/08 11:40:22 [DEBUG] ReferenceTransformer: "data.vsphere_resource_pool.pool" references: [data.vsphere_datacenter.dc]
hableDataResource
data.vsphere_datacenter.dc - *terraform.NodeRefreshableDataResource
provider.vsphere - *terraform.NodeApplyableProvider
var.vsphere_password - *terraform.NodeRootVariable
var.vsphere_server - *terraform.NodeRootVariable
var.vsphere_user - *terraform.NodeRootVariable
provider.vsphere (close) - *terraform.graphNodeCloseProvider
@arno01
arno01 / 0-README.md
Last active January 17, 2019 13:12
Patches for fixing "black screen" issue on MBP with AMD GPU on Linux >=4.18
@arno01
arno01 / docker-on-android.md
Last active October 19, 2023 07:48
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux