Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View AnthonyWC's full-sized avatar
💭
The Net is Vast and Infinite.

AnthonyWC AnthonyWC

💭
The Net is Vast and Infinite.
View GitHub Profile
@focus97
focus97 / hack-your-own-slack-theme.md
Last active April 13, 2023 17:07
How to theme Slack (Dark, Solarized, White, Rosé, whatever)

How to theme Slack v4.12.0+

Update as of 8.08.2021:

  • Hid the bookmarks bar and fine-tuned some header styles.

If you want to add your own style to Slack, here's how.

My quazi-Tron Theme'ish?

I dunno what happened. I just wanted to try something sporty/future-y, I guess. Code for this is directly below.

@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
---
- name: create some vms
hosts: localhost
connection: local
vars_prompt:
- name: "vcenter_host"
prompt: "Enter vcenter host"
private: no
default: "vcsa"
- name: "vcenter_user"
@adamchainz
adamchainz / my_filters.py
Created March 25, 2015 23:10
Ansible Jinja2 filters for deleting anonymous ec2 instances
import datetime as dt
import time
import unittest
def aws_age_seconds(ec2_launch_time):
"""
Parse the ec2 launch time string and return how old it is in seconds.
"""
# Strip trailing subsecond part
@juanje
juanje / Description.md
Last active November 30, 2023 19:29
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }
@dmytro
dmytro / ssh-multi.sh
Created October 31, 2012 03:46
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@dchest
dchest / gist:574388
Created September 10, 2010 21:13
How to add a certificate from buffer in OpenSSL
X509 *cert;
char *zCert;
BIO *mem;
zCert = // get your certificate text buffer here (C string with certificate in PEM format)
mem = BIO_new(BIO_s_mem());
BIO_puts(mem, zCert);
cert = PEM_read_bio_X509(mem, NULL, 0, NULL);
free(zCert);
BIO_free(mem);