Skip to content

Instantly share code, notes, and snippets.

View AmirSoleimani's full-sized avatar
👋

Amir So AmirSoleimani

👋
View GitHub Profile
@AmirSoleimani
AmirSoleimani / README.md
Last active December 12, 2018 12:36
Redis Pub/Sub

Redis Publish/Subscribe Sample

Car: Subscriber

Food: Publisher

@AmirSoleimani
AmirSoleimani / Singleton.go
Created November 19, 2018 17:19
Singleton Pattern - Golang (Simple)
package singleton
import (
"fmt"
"sync"
)
//singleton variables
type singleton map[string]interface{}
@AmirSoleimani
AmirSoleimani / main.go
Last active January 10, 2023 08:18
Pub/Sub Pattern Golang
package main
import (
"patternsample/mq"
"fmt"
"time"
)
func main() {
#!/bin/bash
scrot 'ss.png' -e 'mv $f ~/Pictures'
convert ~/Pictures/ss.png -blur 0x5 ~/Pictures/sss.png
i3lock -f -i ~/Pictures/sss.png
@nikhita
nikhita / update-golang.md
Last active March 29, 2025 15:22
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
set $mod Mod4
#consts
set $w1 1:
set $w2 2:
separator_block_width=15
color=#CCCCCC
align=center
[online-status]
command=echo "ping $(ping -c 1 8.8.8.8 | awk '/from/ {print $7}' | cut -d'=' -f 2)ms"
#||echo ''
#command=ping googe.com || echo asd
#color=#FF0000
interval=40
alias asd="git pull upstream master --rebase"
alias sa="sudo apt-get install"
export GOPATH=~/gopath
export PATH=$PATH:/usr/local/go/bin
export GOBIN=/usr/local/go/bin
@pkuczynski
pkuczynski / LICENSE
Last active March 14, 2025 14:12
Read YAML file from Bash script
MIT License
Copyright (c) 2014 Piotr Kuczynski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR
# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9