Skip to content

Instantly share code, notes, and snippets.

@ix4
ix4 / apache-nginx-ftp
Created October 26, 2022 05:20 — forked from solancer/apache-nginx-ftp
Correct permissions for /var/www/html
# Adding current user to www-data
sudo adduser $USER www-data
# change ownership to user:www-data and
sudo chown $USER:www-data -R /var/www/html
sudo chmod u=rwX,g=srX,o=rX -R /var/www/html
# change file permissions of existing files and folders to 755/644
sudo find /var/www/html -type d -exec chmod g=rwxs "{}" \;
sudo find /var/www/html -type f -exec chmod g=rws "{}" \;
@ix4
ix4 / login-script.sh
Last active November 22, 2021 21:16 — forked from AlBichutsky/login-script.sh
Auto-Translated from Russian
#!/bin/bash
# disable the output of messages to the console if users log in under non-existent names
exec 2>/dev/null
# name of the group that is allowed access on weekends
group="admin"
# check if the user $ PAM_USER belongs to the admin group: no - 0, yes -1
check_group=$(id -Gn $PAM_USER | grep -w $group | awk '{print $2}' | wc -l)
@ix4
ix4 / encode.py
Created October 28, 2020 00:17 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@ix4
ix4 / vg
Created April 18, 2020 11:04 — forked from denpamusic/vg
vpngate.net client for OpenWRT
#!/bin/sh
###
# vpngate.net client for OpenWRT
#
# This script allows to pull server list from vpngate public VPN server registry and filter
# it by country, score, maximum ping and uptime.
#
# Once server that matches requested criteria found, script will setup openvpn
# instance via UCI and perform connection test.
@ix4
ix4 / .block
Created April 7, 2020 00:39 — forked from sc1f/.block
Perspective Workspace for COVID-19 U.S. Data
license: apache-2.0
height: 800
@ix4
ix4 / .block
Created April 7, 2020 00:38 — forked from monodera/.block
Time series of COVID-19 cases (see the texts below)
license: MIT
height: 1600
scrolling: no
border: no
@ix4
ix4 / README.md
Created April 7, 2020 00:21 — forked from susielu/README.md
K-Means Centroid Deviation

K-Means Centroid Deviation

Added all of the Farmers' Markets data into the kMeans Library by @emilbayes, thank you!

Exploring the idea of using the areas around the centroids to exaggerate that cluster when it deviates from the rest of the clusters. This originates from the question "Which features in each cluster differentiate it from the rest?"

@ix4
ix4 / .gitignore
Created April 7, 2020 00:20 — forked from susielu/.gitignore
d3.annotation: Points of Interest
.DS_Store
@ix4
ix4 / vigenere-cipher.py
Created March 14, 2020 20:33 — forked from gowhari/vigenere-cipher.py
vigenere cipher
# encoding: utf8
# vigenere cipher
# https://stackoverflow.com/a/2490718/1675586
def encode(key, string):
encoded_chars = []
for i in range(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)
@ix4
ix4 / .block
Last active March 8, 2020 12:13 — forked from mbostock/.block
Collapsible Indented Tree
license: gpl-3.0
#redirect: https://observablehq.com/@d3/indented-tree