Skip to content

Instantly share code, notes, and snippets.

@ansulev
ansulev / 0_reuse_code.js
Created June 12, 2016 14:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ansulev
ansulev / getBlockLists.sh
Last active December 10, 2017 09:03
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023
# created by https://gist.github.com/glaszig/bf96beccf4694ae25d4f1f7cc6224985
# usage:
# getBlockLists.sh > /tmp/blockp2p.list
# or
# getBlockLists.sh | gzip -9 > /tmp/blockp2p.list.gz
# daily updated: https://silo.glasz.org/antip2p.list.gz
#
@ansulev
ansulev / inst-arch-openrc-btrfs-enc-home
Last active May 29, 2024 14:28
Install Arch Linux with OpenRC on Btrfs with Encrypted Home directory
# Install Arch Linux with OpenRC on Btrfs with Encrypted Home directory
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# OpenRC on Arch Wiki: https://wiki.archlinux.org/index.php/OpenRC
# Arch OpenRC: https://sourceforge.net/projects/archopenrc/files/arch-openrc
# Download the arch-openrc image from https://sourceforge.net/projects/archopenrc/files/latest/download
# Copy to a usb-drive
dd bs=16M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
# Boot from the usb...
@ansulev
ansulev / inst-arch-linux-full-enc
Last active February 2, 2022 06:56
Install Arch Linux with full encrypted file-system using dm-crypt and luks
# Install Arch Linux with full encrypted file-system using dm-crypt and luks
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# SSD specials
# http://ggarcia.me/2016/10/11/arch-linux-ssd-trim.html
# Download the archiso image from https://www.archlinux.org/download/
# Copy to a usb-drive
dd bs=16M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
@ansulev
ansulev / sublime-text-3-packages-web.txt
Last active December 14, 2018 10:30
Sublime Text 3 packages for Web Development
AdvancedNewFile
Alignment
All Autocomplete
AutoFileName
Babel
Base16 Color Schemes
BracketHighlighter
Color Highlighter
Color Picker
DocBlockr
@ansulev
ansulev / install-arch-linux-on-btrfs-subvolume-inside-luks
Last active October 20, 2024 07:09
Install Arch Linux with full encrypted btrfs subvolume inside luks
# Install Arch Linux with full encrypted btrfs subvolume inside luks
# Hardware: BIOS system, Intel GPU, Nvidia Optimus, Toshiba SSD, Wifi
# Please adjust for your needs.
# filename: install-arch-linux-on-btrfs-subvolume-inside-luks.txt
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# Download the archiso image from https://www.archlinux.org/download/
# Copy to a usb-drive
dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
@ansulev
ansulev / nginx-force-non-www-ssl-pwsite.conf
Last active August 27, 2017 12:42
Nginx site configuration for ProcessWire with forced SSL and www to non-www redirect
# nginx site config for processwire with forced SSL and www to non-redirect
# redirect from www to non-www forced SSL
# uncomment, save file and restart Nginx to enable
# if unsure use return 302 before using return 301
server {
server_name domain.com www.domain.com;
return 301 https://$server_name$request_uri;
}
@ansulev
ansulev / mimeapps.list
Last active August 15, 2019 19:26
mimeapps.list
[Removed Associations]
application/x-extension-txt=libreoffice-writer.desktop;
text/plain=libreoffice-writer.desktop;
application/x-iwork-keynote-sffkey=libreoffice-impress.desktop;
[Added Associations]
application/ogg=deadbeef.desktop;pragha.desktop;mpv.desktop;mplayer.desktop;vlc.desktop;audacity.desktop;easytag.desktop;
application/sdp=mpv.desktop;mplayer.desktop;vlc.desktop;
application/smil=mpv.desktop;mplayer.desktop;vlc.desktop;
application/streamingmedia=mpv.desktop;mplayer.desktop;vlc.desktop;
@ansulev
ansulev / nginx.conf
Last active August 26, 2024 14:23
Ultimate nginx configuration for improved security and performance.
#
# /etc/nginx/nginx.conf
#
user http;
worker_processes 1;
worker_priority -10;
worker_rlimit_nofile 260000;
timer_resolution 100ms;
@ansulev
ansulev / install-nginx-php7-fpm-aws-rhel7.txt
Last active February 26, 2020 01:28
Install Nginx and PHP7-FPM on AWS with RHEL7
#
# Install and configuration Nginx, PHP7-FPM on AWS with RHEL7
#
# Install REMI and EPEL repos
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# Install PHP and Nginx
yum --enablerepo=remi,remi-php70 install nginx php-fpm php-common