Skip to content

Instantly share code, notes, and snippets.

View ssi-anik's full-sized avatar
💻
Open to remote work!

Syed Sirajul Islam Anik ssi-anik

💻
Open to remote work!
View GitHub Profile
@hershkoy
hershkoy / gdrive_get_large_file.sh
Created December 9, 2020 08:27
Download large file from Google Drive (2020)
#!/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
@Maxzor
Maxzor / remove-all-from-docker-oneliner.sh
Last active December 21, 2023 19:51 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
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;
@antfu
antfu / 📊 Weekly development breakdown
Last active November 20, 2023 10:25
📊 Weekly development breakdown
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%
@joaorbrandao
joaorbrandao / SelfReferenceTrait.php
Last active October 26, 2023 14:27
Laravel Model Self Reference
<?php
namespace App\Traits;
trait SelfReferenceTrait
{
protected $parentColumn = 'parent_id';
public function parent()
{
@mohamedhafezqo
mohamedhafezqo / example.php
Last active March 3, 2024 22:22
GraphQL Client For PHP Using Guzzle
<?php
$endPoint = 'https://api.github.com/graphql';
$query = <<<'GRAPHQL'
query getUsers {
user {
id
name
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@jesugmz
jesugmz / generate-docker-base64-auth-token.md
Created August 20, 2018 00:00
Generate Docker base64 auth token

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
@sonhmai
sonhmai / kafka
Last active March 10, 2024 19:48
kafka basic commands
# 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
@willmendesneto
willmendesneto / medis-installer.sh
Last active June 19, 2023 11:56
Script to build and install Redis Desktop Manager Medis Locally on MacOS
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
@zikes
zikes / .zshrc
Last active November 14, 2022 03:45
Using kube-ps1 with P9K
# 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'