THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
#!/bin/sh | |
# script for optimizing images in a directory (recursive) | |
# pngcrush & jpegtran settings from: | |
# http://developer.yahoo.com/performance/rules.html#opt_images | |
# pngcrush | |
for png in `find $1 -iname "*.png"`; do | |
echo "crushing $png ..." | |
pngcrush -rem alla -reduce -brute "$png" temp.png |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
<?php | |
/* | |
@name Server Logs Viewer | |
@description Emulates the tail() function. View the latest lines of your LAMP server logs in your browser. | |
@author Alexandre Plennevaux (pixeline.be) | |
@team Oleg Basov ([email protected]) | |
@date 16.12.2015 | |
*/ |
First, install the necesssary packages:
% apt-get install libpam-oath oathtool
Generate a key and write it to /etc/users.oath
(NB the key will be in hexadecimal; if you are using Authy you will want to convert it to BASE32):
% KEY=$( head -c 1024 /dev/urandom | openssl sha1 | awk '{ print $2 }' )
% echo "HOTP/T30/6 andrewlkho - ${KEY}" >> /etc/security/users.oath
% chmod 600 /etc/users.oath
/* | |
* Copyright (C) 2004-2015 ZNC, see the NOTICE file for details. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.
Audio source (i.e. smartphone)
|
v
((( Wireless Bluetooth Channel )))
|
def progress_bar(current, total, bar_length=50): | |
percent = int(round((current / total) * 100)) | |
nb_bar_fill = int(round((bar_length * percent) / 100)) | |
bar_fill = '#' * nb_bar_fill | |
bar_empty = ' ' * (bar_length - nb_bar_fill) | |
sys.stdout.write(f"\r [{str(bar_fill + bar_empty)}] {percent}% ({current}/{total}) ") | |
sys.stdout.flush() | |
def bar_example(): | |
for i in range(20): |
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
True fact: Mon server MariaDB s'est fait attaqué comme ça alors que le port dans l'iptable n'était pas ouvert.
#!/bin/env bash | |
# Usage : | |
# ffwebm input_file output_file [video_bitrate [audio_bitrate]] | |
INPUT=${1} | |
OUTPUT=${2} | |
BITRATE=${3:-1000k} | |
AUDIO_BITRATE=${4:-64k} |