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 [ $# != 2 ]; then | |
echo "Usage: googledown.sh ID save_name" | |
exit 0 | |
fi | |
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='$1 -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') | |
echo $confirm | |
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$confirm&id=$1" -O $2 && rm -rf /tmp/cookies.txt |
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
echo "Removing containers :" && if [ -n "$(docker container ls -aq)" ]; then docker container stop $(docker container ls -aq); docker container rm $(docker container ls -aq); fi; echo "Removing images :" && if [ -n "$(docker images -aq)" ]; then docker rmi -f $(docker images -aq); fi; echo "Removing volumes :" && if [ -n "$(docker volume ls -q)" ]; then docker volume rm $(docker volume ls -q); fi; echo "Removing networks :" && if [ -n "$(docker network ls | awk '{print $1" "$2}' | grep -v 'ID\|bridge\|host\|none' | awk '{print $1}')" ]; then docker network rm $(docker network ls | awk '{print $1" "$2}' | grep -v 'ID\|bridge\|host\|none' | awk '{print $1}'); 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
TypeScript 21 hrs 47 mins ████████████████▒░░░ 67.1% | |
Vue.js 6 hrs 21 mins ██████▓░░░░░░░░░░░░░ 19.6% | |
JSON 2 hrs 10 mins ████▒░░░░░░░░░░░░░░░ 6.7% | |
JavaScript 46 mins ███▒░░░░░░░░░░░░░░░░ 2.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
<?php | |
namespace App\Traits; | |
trait SelfReferenceTrait | |
{ | |
protected $parentColumn = 'parent_id'; | |
public function parent() | |
{ |
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 | |
$endPoint = 'https://api.github.com/graphql'; | |
$query = <<<'GRAPHQL' | |
query getUsers { | |
user { | |
id | |
name | |
} |
docker login
will produce a base64 digest if the binaries pass
and secretservice
are not present on Linux platforms (source).
To generate a base64 auth token:
echo -n 'username:password' | base64
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
# BENCHMARK----------------------------------------------------- | |
#1. Rust kafka-benchmark (https://github.com/fede1024/kafka-benchmark) | |
# must create topic with 6 partitions first | |
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 6--topic [scenario] | |
# replace scenario with one in file kafka-benchmark/config/base_producer.yaml |
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
echo "Installing Redis Desktop Manager 'Medis'" | |
[ -d ~/medis ] || git clone https://github.com/luin/medis.git ~/medis | |
cd ~/medis | |
npm install && npm run pack | |
cp -rf out/Medis-mas-x64/Medis.app /Applications/ | |
cd ~ && rm -rf ~/medis |
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
# Enable the kube-ps1 oh-my-zsh plugin | |
plugins = ( | |
git | |
kube-ps1 | |
) | |
# The output of the kube_ps1 function is text, so it can be used | |
# directly as a custom p9k segment | |
POWERLEVEL9K_CUSTOM_KUBE_PS1='kube_ps1' |
NewerOlder