Skip to content

Instantly share code, notes, and snippets.

View svyatov's full-sized avatar
👨‍💻

Leonid Svyatov svyatov

👨‍💻
View GitHub Profile
@svyatov
svyatov / slack_delete.rb
Created July 9, 2017 20:20 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@svyatov
svyatov / le-renew-webroot
Last active October 4, 2020 03:23 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file='/usr/local/etc/le-renew-webroot.ini'
le_path='/opt/letsencrypt'
exp_limit=15;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
#!/bin/sh
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
echo ""
echo "Displaying ASCII control characters using caret notation in standard text views"
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
echo ""
echo "Disable smart quotes and smart dashes as they're annoying when typing code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false