Skip to content

Instantly share code, notes, and snippets.

View Niraj-Fonseka's full-sized avatar
📚

Niraj Fonseka Niraj-Fonseka

📚
View GitHub Profile
@Niraj-Fonseka
Niraj-Fonseka / count_git_lines.sh
Created June 3, 2018 19:08
Counting Number of lines in a Git Repo
#!/bin/bash
git ls-files | xargs wc -l
@Niraj-Fonseka
Niraj-Fonseka / ssh_script.sh
Created July 16, 2018 05:17
ssh_shell_script.sh
#!/bin/bash
SCRIPT="cd "
HOSTS=("192.168.0.11")
USERNAMES=("username")
PASSWORDS=("password")
for i in ${!HOSTS[*]} ; do
echo ${HOSTS[i]}
SCR=${SCRIPT/PASSWORD/${PASSWORDS[i]}}
sshpass -p ${PASSWORDS[i]} ssh -l ${USERNAMES[i]} ${HOSTS[i]} "${SCR}"
done
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
package main
import (
"fmt"
"sync"
"time"
)
var wg sync.WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
var wg sync.WaitGroup
brew install mysql
brew tap homebrew/services
brew services start mysql
package main
import (
"log"
"gocv.io/x/gocv"
)
func main() {
webcam, err := gocv.VideoCaptureDevice(0)
@Niraj-Fonseka
Niraj-Fonseka / gocv-haar.go
Last active July 29, 2019 04:47
gocv-haar.go
package main
import (
"fmt"
"image/color"
"log"
"gocv.io/x/gocv"
)
#!/bin/sh
echo " ---- Getting credentials for the hd-engineering cluster ---- "
gcloud container clusters get-credentials hd-engineering-cluster --zone us-central1-a --project hd-engineering
echo " ---- Creating a ephemeral pod in the retooling cluster ---- "
echo " ---- run -> telnet internalhostip 6379 to connect to the memorystore instance "
kubectl -n retooling run memorystore-proxy --rm -i --tty --image us.gcr.io/hd-engineering/memorystore-proxy -- bash
package main
import (
"grpc_stream_medium/server/sensorpb"
"log"
"net"
"google.golang.org/grpc"
)