Skip to content

Instantly share code, notes, and snippets.

@yoghi
yoghi / proxy.md
Created May 8, 2020 22:07 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@yoghi
yoghi / debian_upgrade.yml
Created March 15, 2020 18:14 — forked from maethor/debian_upgrade.yml
Ansible playbook to update and upgrade Debian hosts
---
- hosts: all
sudo: yes
tasks:
- name: Update packages list
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: List packages to upgrade (1/2)
@yoghi
yoghi / CN-cloud-disk-providers.md
Created February 29, 2020 11:07 — forked from weakish/backup-providers.md
reviews of vps, storage, mail forward

Cloud disks in China

Cloud disks with API in China

  • space: 100GB+
  • file limit: 100MB (web) 1GB(client)
UserReadableName = Fairphone FP3 (api28)
Build.HARDWARE = qcom
Build.RADIO = unknown
Build.BOOTLOADER = unknown
Build.FINGERPRINT = Fairphone/FP3/FP3:9/8901.2.A.0096.20191001/10011803:user/release-keys
Build.BRAND = Fairphone
Build.DEVICE = FP3
Build.VERSION.SDK_INT = 29
Build.MODEL = FP3
Build.MANUFACTURER = Fairphone
# Install PIP
curl -LO https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
export PATH=$HOME/.local/bin:$PATH
# Install ansible
pip install ansible --user
# Run ansible
ansible --version
@yoghi
yoghi / download-frozen-image-v2-custom.sh
Created July 27, 2018 10:58
Download docker images without docker
#!/usr/bin/env bash
set -eo pipefail
# hello-world latest ef872312fe1b 3 months ago 910 B
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B
# debian latest f6fab3b798be 10 weeks ago 85.1 MB
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
=============== MYSQL/MARIADB ===============
#!/bin/bash
echo "Waiting for mysql"
until mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" &> /dev/null
do
printf "."
sleep 1
done
@yoghi
yoghi / vpn.md
Created February 14, 2018 08:38 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

(A Russian translation of this article can be found here, contributed by Timur Demin.)

Why not?

@yoghi
yoghi / trim_pfsense2.2.4.md
Created October 18, 2017 22:21 — forked from mdouchement/trim_pfsense2.2.4.md
Enable TRIM on pfsense 2.2.4

Installation

Use memstick-licecd to install pfsense on your SSD.

Enable TRIM

  • Initialize fstab:
[2.2.4-RELEASE][[email protected]]/root: /usr/local/sbin/ufslabels.sh

It may do nothing because all is already initialize but it's only in a case of

@yoghi
yoghi / OverEncrypt.md
Last active December 16, 2016 16:17 — forked from mapmeld/OverEncrypt.md
OverEncrypt - paranoid HTTPS

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone