Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
dreamcat4 / instructions.md
Last active July 15, 2022 17:39
How to configure ubuntu budgie for graphical alt-tab with external program 'skippy-xd'

How to configure Ubuntu Budgie for Alt-Tab with Skippy-XD

This guide assumes that you have already compiled and installed skippy-xd from here. You will probably need to compile it from source, then sudo make install. Because there is no PPA / .deb package made for it yet.

  • Check that you have the right version of skippy, by typing on the cmdline:
skippy-xd --help | grep -i 'puzzlebox'
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@shatil
shatil / make.py
Created June 25, 2017 07:07
Generate docker-compose.yml `services` entries dynamically with Python
#!/usr/bin/env python3
from __future__ import print_function
try:
from ruamel import yaml
except ImportError:
import yaml
# Map a Docker Compose "service" name to its image.
############################################
# Instance info
############################################
INSTANCE_ID=$(/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id)
EC2_AVAIL_ZONE=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
REGION="`echo \"$EC2_AVAIL_ZONE\" | /bin/sed -e 's:\([0-9][0-9]*\)[a-z]*\$:\\1:'`"
ENI_ID="${ENI_ID}" # have terraform or whatever you're using provide this
ENI_IP=$(/usr/bin/aws ec2 describe-network-interfaces --region=${REGION} | \
/usr/bin/jq -cr --arg i "${ENI_ID}" '.NetworkInterfaces[]|select(.NetworkInterfaceId==$i).PrivateIpAddress')
NETCIDR="${ENI_IP%.*}.0/24" # yeah, it's defaults for my network, put in whatever it is for you
@maxivak
maxivak / readme.md
Last active March 30, 2019 01:09
Storage for Docker containers in Swarm mode

Manage data in containers in swarm mode

Overview

Approaches to data storages:

  • Default : No Data Persistence
  • Data Volumes : Container Persistence
  • Explicit Shared Storage (Data Volumes) : Container Persistence
  • Shared Multi-Host Storage : Host Persistence
@timotgl
timotgl / uninstall-razer-synapse.sh
Last active October 28, 2024 13:32
How to fully uninstall Razer Synapse 2 on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) without using Razer's official uninstall tool
# How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 )
# on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra)
# without using Razer's official uninstall tool.
# Tested on OS X 10.11.5 in July 2016.
# Edited with additional steps for later OS X versions,
# contributed by commenters on this gist.
# Step 1: In your terminal: stop and remove launch agents
launchctl remove com.razer.rzupdater
@ogavrisevs
ogavrisevs / aws-temp-token.sh
Created July 29, 2015 16:36
Script to generate AWS STS token
#!/bin/bash
#
# Sample for getting temp session token from AWS STS
#
# aws --profile youriamuser sts get-session-token --duration 3600 \
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345
#
# Based on : https://github.com/EvidentSecurity/MFAonCLI/blob/master/aws-temp-token.sh
#
@tjcorr
tjcorr / gist:3baf86051471062b2fb7
Last active August 8, 2021 22:31
CloudFormation to demo etcd-aws-cluster
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An etcd cluster based off an auto scaling group",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-840a0899"
},
"ap-northeast-1" : {
"AMI" : "ami-6c5ac56c"
@alister
alister / DockerRedis_ExportImport_Dump.sh
Created January 27, 2015 21:46
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis
@arunoda
arunoda / gist:7790979
Last active September 10, 2024 08:43
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X