Skip to content

Instantly share code, notes, and snippets.

@mcnilz
mcnilz / install-dev.system.bash
Created March 25, 2020 08:52
install-dev-system
#!/bin/bash
apt-get update
apt-get -y upgrade
apt-get install -y \
git \
git-lfs \
mc \
zsh \
haveged
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active May 28, 2024 15:00
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,
@BFTrick
BFTrick / sql-command.sql
Last active April 25, 2022 14:31
A SQL command to delete all orphaned post meta data
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL