Skip to content

Instantly share code, notes, and snippets.

View claudusd's full-sized avatar
🚨
O(o)ps

Claude Dioudonnat claudusd

🚨
O(o)ps
View GitHub Profile
@egelev
egelev / connect_bluetooth_headphones.sh
Last active April 26, 2024 14:14
Connect bluetooth headphones on Ubuntu 18.04
#!/usr/bin/env bash
function get_headphones_index() {
echo $(pacmd list-cards | grep bluez_card -B1 | grep index | awk '{print $2}')
}
function get_headphones_mac_address() {
local temp=$(pacmd list-cards | grep bluez_card -C20 | grep 'device.string' | cut -d' ' -f 3)
temp="${temp%\"}"
temp="${temp#\"}"
@avoidik
avoidik / vault_oidc.sh
Created October 6, 2019 09:45
Vault OIDC command line
r#!/usr/bin/env bash
# -*- coding: utf-8 -*-
###############################################################################################
##
## This script should be run manually and will authenticate a user to Vault via the OIDC
## workflow.
##
###############################################################################################
@cGuille
cGuille / post-commit
Last active May 10, 2016 11:48
Git post-commit hook to display the commit message in an enclosing sentence. The goal is to check whether the commit message wording feels right or not.
#!/usr/bin/env bash
LIGHT_GREEN='\e[1;32m'
NO_FORMAT='\e[0m'
UNDERLINE='\e[4m'
RESET_UNDERLINE='\e[24m'
COMMIT_MESSAGE="$(git show -s --format=%s HEAD)"
echo -e "${LIGHT_GREEN}When applied, this commit will ${UNDERLINE}${COMMIT_MESSAGE}${RESET_UNDERLINE}.${NO_FORMAT}"
@BenMorel
BenMorel / .travis.install-mysql-5.7.sh
Last active December 6, 2019 06:24
Install MySQL 5.7 on Travis-CI
sudo apt-get remove --purge "^mysql.*"
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /var/log/mysql
echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7-dmr | sudo debconf-set-selections
wget http://dev.mysql.com/get/mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo dpkg --install mysql-apt-config_0.2.1-1ubuntu12.04_all.deb
sudo apt-get update -q
sudo apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" mysql-server
@Ocramius
Ocramius / Foo.php
Last active March 12, 2021 14:14
Self hydrating object proxy in PHP Provides faster hydration by removing the need for reflection.
<?php
class Foo
{
protected $foo;
protected $bar;
protected $baz;
}
@mardix
mardix / php-cs-fixer-pre-commit.php
Created September 4, 2012 17:06
A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@ifred
ifred / away-on-lock-x.py
Created June 6, 2012 09:33 — forked from icgood/away-on-lock-x.py
Sets and clears away status in pidgin/purple when xscreensaver locks and unlocks the screen.
#!/usr/bin/env python2
# Author: Ian Good <ian.good@rackspace.com>
# Inspired by http://costela.net/projects/awayonlock/
# Use at your own risk!
import os
import sys
import signal
import hashlib