kubectl get replicasets --all-namespaces -o json | jq '.items[] | select(.status.readyReplicas<1) | "kubectl delete replicasets \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extend the disk using fdisk (after the disk image itself has been extended): | |
fdisk -u /dev/sda | |
- Use the option p to print the partition table (you will need the start position later) | |
- Delete the partition with option d | |
- Add a new partition with option n | |
- Create a primary partition with P and give this the partition number 1 | |
- For the first sector, use the start position from step 2 | |
- Use the defaultvalue for the last sector | |
- Check your changes by printing the partition table again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# System-wide crontab file and cron job directory. Change these for your system. | |
CRONTAB='/etc/crontab' | |
CRONDIR='/etc/cron.d' | |
# Single tab character. Annoyingly necessary. | |
tab=$(echo -en "\t") | |
# Given a stream of crontab lines, exclude non-cron job lines, replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -t 0 ]; then | |
# Terminal input (keyboard) - interactive | |
docker exec -it mariadb mysql $@ | |
else | |
# File or pipe input - non-interactive | |
docker exec -i mariadb mysql $@ | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# find ~/Music -name '*.m4a' -exec ~/bin/remove-dupe.sh {} \; | |
M4A_FILE=$1 | |
MP3_FILE="${M4A_FILE%.*}.mp3" | |
if [ -f "$MP3_FILE" ]; then | |
rm -rf "$MP3_FILE" | |
echo "Removed $MP3_FILE" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MqttClient | |
{ | |
private $server; | |
private $port; | |
private $user; | |
private $password; | |
public function __construct($server, $port = 1883, $user = '', $password = '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://github.com/granadaxronos/120-SONG_NOKIA_RTTTL_RINGTONE_PLAYER_FOR_ARDUINO_UNO | |
#define OCTAVE_OFFSET 0 | |
#define isdigit(n) (n >= '0' && n <= '9') | |
int tone_pin = 4; // You can assing any digital output pin for speaker output! | |
void play_RTTTL(char* p){ | |
byte default_dur = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List all old kernels that can be removed (Debian) : | |
dpkg -l linux-{image,headers}-* | awk '/^ii/{print $2}' | egrep '[0-9]+\.[0-9]+\.[0-9]+' | grep -v $(uname -r) | |
Remove them using dpkg --purge : | |
ie. dpkg --purge linux-headers-3.13.0-86 linux-headers-3.13.0-86-generic linux-image-3.13.0-86-generic linux-image-extra-3.13.0-86-generic | |
Afterwards run apt-get autoremove (if needed preceded by apt-get -f install). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int speakerPin = 9; | |
int length = 46; | |
String notes[] = {"G4","G4", "G4", "D#4/Eb4", "A#4/Bb4", "G4", "D#4/Eb4","A#4/Bb4", "G4", "D5", "D5", "D5", "D#5/Eb5", "A#4/Bb4", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4", "G5","G4","G4","G5","F#5/Gb5", "F5","E5","D#5/Eb5","E5", "rest", "G4", "rest","C#5/Db5","C5","B4","A#4/Bb4","A4","A#4/Bb4", "rest", "D#4/Eb4", "rest", "F#4/Gb4", "D#4/Eb4","A#4/Bb4", "G4" ,"D#4/Eb4","A#4/Bb4", "G4"}; | |
int beats[] = { 8, 8, 8, 6, 2, 8, 6 , 2 ,16 , 8, 8, 8, 6, 2, 8, 6, 2, 16,8,6,2,8,6,2,2, 2, 2,6,2,2,8,6,2,2,2,2,6,2,2,9,6,2,8,6,2,16 }; | |
int tempo = 50; | |
void playTone(int tone, int duration) { | |
for (long i = 0; i < duration * 1000L; i += tone * 2) { | |
digitalWrite(speakerPin, HIGH); | |
delayMicroseconds(tone); |
I hereby claim:
- I am wimvds on github.
- I am wimvds (https://keybase.io/wimvds) on keybase.
- I have a public key is ASD19plOvA6jRlJ5vT9FADGueBzOy7Y8LLSL_K-u4fhs-Ao
To claim this, I am signing this object:
NewerOlder