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 | |
#v1.1 | |
docker rm -v $(docker ps --filter status=exited -q 2>/dev/null) 2>/dev/null | |
docker rmi $(docker images --filter dangling=true -q 2>/dev/null) 2>/dev/null | |
rm -rf /var/lib/docker/tmp/* |
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
#!/usr/bin/env bash | |
#from | |
#https://superuser.com/questions/109213/how-do-i-list-the-ssl-tls-cipher-suites-a-particular-website-offers | |
# OpenSSL requires the port number. | |
SERVER=localhost:443 | |
DELAY=1 | |
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g') | |
echo Obtaining cipher list from $(openssl version). |
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 the containers | |
dcos task | |
#get the desired ID and run the next command | |
dcos task log --follow {ID} |
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 | |
#This starts an ubuntu container with admin rights on the host file system | |
#Useful on bad configure docker machines | |
#--------------------------------------------------------------------------------- | |
#USE WITH CAUTION !!!! | |
docker run -t -i -v /:/host ubuntu /bin/bash | |
#USE WITH CAUTION !!!! | |
#--------------------------------------------------------------------------------- |
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.stream().map(Integer::parseInt).toArray(Integer[]::new) |
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
SPACE_USED=$(df -h /dev/disk1 | grep -vE '/dev/disk1' | awk 'FNR == 2 { print $4 }' | cut -d '%' -f1 ) | |
if [ $SPACE_USED -ge 90 ]; then | |
alert=$( echo "Running out of space on $(hostname) $SPACE_USED % used already") | |
curl -X POST --data-urlencode "payload={\"text\": \"$alert\"}" "your slack hook address goes here" | |
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
ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 | |
out_w is the width of the output rectangle | |
out_h is the height of the output rectangle | |
x and y specify the top left corner of the output rectangle | |
ffmpeg.exe -i AW0001.mp4 -filter:v "crop=1280:720:0:0" camera1.mp4 | |
ffmpeg.exe -i AW0001.mp4 -filter:v "crop=1280:720:0:720" camera2.mp4 |
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
git rm --cached submodule_path # delete reference to submodule HEAD (no trailing slash) | |
git rm .gitmodules # if you have more than one submodules, | |
# you need to edit this file instead of deleting! | |
rm -rf submodule_path/.git # make sure you have backup!! | |
git add submodule_path # will add files instead of commit reference | |
git commit -m "remove submodule" |
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
//mode1 | |
git submodule foreach --recursive git pull origin master | |
//mode2 | |
git submodule update --recursive | |
//depending on the aligment of the planets, sometimes mode1 or mode2 works, sometimes none of them |
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
Nokogiri::XML('string with problem').serialize(:encoding => 'UTF-8') |
NewerOlder