Skip to content

Instantly share code, notes, and snippets.

@shvchk
shvchk / Start application minimized.md
Created November 4, 2016 19:20
Start application minimized

Start application minimized

Usage

python3 /path/to/start_minimized.py <command_to_run_application>

Prerequisites

Install wmctrl and xdotool: sudo apt-get install wmctrl xdotool

Source

Jacob Vlijm answer on AskUbuntu

Set up SSH key based authentication

SSH keys come in pairs: a public and a private key. It might be easier to think of them as a lock (public part) and key (private part). You add public key (lock) to the computer you want to connect to, and then you can connect from elswhere and unlock it with your private key. So public key is meant to be handed out freely, while private key should be kept secret and safely guarded.

So let's create an SSH key (all commands below are executed on your local computer, from which you will be connecting to remote example.com):

  1. Make sure local user has .ssh directory: mkdir -p ~/.ssh

  2. Generate SSH keys for passwordless authentication:

Были рассмотрены практически все имеющиеся 5" смартфоны с 3GB RAM до 130$, и из них отобраны наиболее конкурентоспособные исходя из характеристик и цены, их и будем сравнивать.

Участники

  1. Vernee Thor
  2. Vernee Thor E
  3. Meizu M5
  4. Meizu U10
  5. Xiaomi Redmi 4X

Keybase proof

I hereby claim:

  • I am shvchk on github.
  • I am shevchuk (https://keybase.io/shevchuk) on keybase.
  • I have a public key whose fingerprint is 6E28 CD88 F9A6 CB2B F5FE D967 D970 4253 BBB6 ECFC

To claim this, I am signing this object:

@shvchk
shvchk / Install Signal Desktop as a standalone app.md
Last active November 8, 2017 08:20
Deprecated, please use official standalone Signal Desktop: https://signal.org
#! /usr/bin/env sh
DEFAULT_DL_LIMIT="32" # KB/s
APT_LAST_UPDATE_FILE="$HOME/.apt-last-update"
NICE="nice -n 19 ionice -c 3 trickle -s -d ${1:-$DEFAULT_DL_LIMIT}"
sudo $NICE apt update
touch $APT_LAST_UPDATE_FILE
#! /usr/bin/env sh
DEFAULT_DL_LIMIT="32" # KB/s
APT_LAST_UPDATE_FILE="$HOME/.apt-last-update"
NICE="nice -n 19 ionice -c 3 trickle -s -d ${1:-$DEFAULT_DL_LIMIT}"
if [ -e $APT_LAST_UPDATE_FILE ] && [ $(( $(date +%s) - $(date +%s -r $APT_LAST_UPDATE_FILE) )) -le 3600 ]
then
echo "APT package lists updated less than an hour ago, skipping"
else
#! /usr/bin/env sh
DEFAULT_DL_LIMIT="32" # KB/s
APT_LAST_UPDATE_FILE="$HOME/.apt-last-update"
NICE="nice -n 19 ionice -c 3 trickle -s -d ${1:-$DEFAULT_DL_LIMIT}"
if [ -e $APT_LAST_UPDATE_FILE ] && [ $(( $(date +%s) - $(date +%s -r $APT_LAST_UPDATE_FILE) )) -le 3600 ]
then
echo "APT package lists updated less than an hour ago, skipping"
else
#! /usr/bin/env sh
USERNAME="support"
AVATAR_URL="https://shevchuk.co/cog.png"
AVATAR_FILE="/home/$USERNAME/.face"
sudo adduser --uid 555 --gecos "" $USERNAME
sudo adduser $USERNAME sudo
sudo wget -qO $AVATAR_FILE $AVATAR_URL
sudo chown $USERNAME:$USERNAME $AVATAR_FILE