Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jackcarter
jackcarter / slack_delete.py
Last active November 29, 2023 07:03
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@matchaxnb
matchaxnb / regenerate-images.php
Created May 20, 2015 14:56
Regenerate images in Prestashop from command line
<?php
define('_PS_ROOT_DIR_', '/path/to/prestashop/root');
define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder');
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(_PS_ADMIN_DIR_.'/functions.php');
class Employee2 extends EmployeeCore
{
public function isSuperAdmin()
@maethor
maethor / debian_upgrade.yml
Created July 18, 2014 14:06
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)
@todgru
todgru / starttmux.sh
Last active March 3, 2024 15:40
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: