Skip to content

Instantly share code, notes, and snippets.

View Niraj-Fonseka's full-sized avatar
📚

Niraj Fonseka Niraj-Fonseka

📚
View GitHub Profile
package main
import (
"fmt"
"sync"
"time"
)
var wg sync.WaitGroup
package main
import (
"fmt"
"sync"
"time"
)
var wg sync.WaitGroup
package main
import (
"fmt"
"time"
)
func main() {
start := time.Now()
@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
@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