Skip to content

Instantly share code, notes, and snippets.

View czerasz's full-sized avatar

Michał Czeraszkiewicz czerasz

View GitHub Profile
@jonathantito
jonathantito / FreebudsPro.md
Last active March 6, 2024 03:41 — forked from Aritzherrero4/FreebudsPro.md
Huawei Freebuds 4i on Ubuntu 20.04

Huawei Freebuds Pro - Linux (KDE Neon) configuration and AAC audio

The default configuration of KDE Neon does not work with the headphones. I have managed to connect them doing some changes, and adjusting some configurations. This resumes that, to keep it if I need to reconfigure them in the future.

This configuration has worked for me using the following setup:

  • KDE Neon 5.20, kernel 5.4.0
  • Freebuds Pro version 1.9.0.256
@andyshinn
andyshinn / Dockerfile
Created December 24, 2015 19:07
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@thisismitch
thisismitch / le-renew-webroot
Last active January 5, 2021 15:20
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=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@janeczku
janeczku / vultr-coreos-bootstrap.sh
Last active August 13, 2021 15:14
Cloud-config for CoreOS IPXE deployment on Vultr. Provisioning etcd, fleet, private network and docker compatible firewall. #tags: foo, bar
#!/bin/bash
# Cloud-config for CoreOS IPXE deployment on Vultr
##################################################
# This cloud-config bootstraps CoreOS on /dev/vda and provisions:
# - private ip-address on eth1
# - etcd on private network
# - fleet on private network
# - basic firewall (docker compatible)
# - SSHd security hardening
##################################################
@zekta
zekta / consul.sh
Last active August 29, 2015 14:19 — forked from ianunruh/consul.sh
#!/bin/bash
apt-get install -y curl unzip
mkdir -p /var/lib/consul
mkdir -p /usr/share/consul
mkdir -p /etc/consul/conf.d
curl -OL https://dl.bintray.com/mitchellh/consul/0.5.0_linux_amd64.zip
unzip 0.5.0_linux_amd64.zip
mv consul /usr/local/bin/consul
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@jlong
jlong / SassMeister-input.scss
Created February 1, 2014 22:53
Navigate a nested maps with map-fetch() in Sass
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
//
// map-fetch($map, $keys)
//
// An easy way to fetch a deep value in a multi-level map. Works much like
// map-get() except that you pass multiple keys as the second parameter to
@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@hzlzh
hzlzh / gist:3128038
Created July 17, 2012 08:31
console.log() snippet for Sublime Text 2
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>conl</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@czerasz
czerasz / autossh.c
Last active July 25, 2016 01:58
useful commands
// Compile with
// gcc -o /etc/bin/autossh autossh.c
#include <stdio.h>
int main(int argc, char *argv[]) {
while(1) {
sleep(60);
printf(".\n");
}
}