Skip to content

Instantly share code, notes, and snippets.

View a7madM's full-sized avatar

Ahmed Magdy a7madM

View GitHub Profile
@a7madM
a7madM / containers_monitor.sh
Last active October 22, 2020 15:50
Monitor containers and restart not working ones
#!/bin/bash
# Reference https://gist.github.com/haukurk/a6e0751a8b8746265f8b2c55d9476230
declare -a containers
containers[0]=container_name_1
containers[1]=container_name_2
containers[2]=container_name_3
# more containers...
@a7madM
a7madM / primes.go
Created February 21, 2019 14:29
Primes in Golang
package main
import (
"fmt"
"math"
)
func main() {
sum := summation(2000000)
fmt.Println(sum)
@a7madM
a7madM / primes.rb
Created February 21, 2019 14:28
Primes Ruby
class Primes
def prime?(n)
return false if n < 2
max = Math.sqrt(n).floor
(2..max).none? { |k| (n % k).zero? }
end
def below(limit)
primes = [2]
google-chrome www.youtube.com
off_day() {
echo "Off Day, Happy Weekend"
}
working_day() {
echo "Happy Working"
require 'uri'
require 'net/http'
require 'pp'
require 'json'
natega = File.new('natega.txt', 'w')
seat_number = 427_360 # write start seat number
count = 10
(seat_number..seat_number + count).each do |seat|