Skip to content

Instantly share code, notes, and snippets.

View AhmedKamal20's full-sized avatar
🐧
Linuxing

Ahmed Kamal AhmedKamal20

🐧
Linuxing
View GitHub Profile
@AhmedKamal20
AhmedKamal20 / libra.md
Last active June 20, 2019 14:01
Try Libra TestNet On Ubuntu Docker

Clone The Repo

git clone https://github.com/libra/libra.git && cd libra

Run Ubuntu Image

docker run -it --name libra -v $PWD:/root/libra --workdir /root/libra ubuntu bash

Update And Install some necessary dependencies

apt update
apt install sudo curl zip git

#!/usr/bin/env ruby
# Prerequisite :
# - On local
# Ruby
# - On local
# Docker (Optional)
# iostat (Optional)
@AhmedKamal20
AhmedKamal20 / docker.sh
Last active April 10, 2023 00:07
Install Docker & Docker Compose
# Install Docker on Ubuntu
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt update
sudo apt install ca-certificates curl gnupg
sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@AhmedKamal20
AhmedKamal20 / Export-Import.md
Last active November 14, 2018 16:12
Export & Import Docker Images From Docker-Compose File Offline

To Export

docker save -o services.tar `docker-compose config | awk '{if ($1 == "image:") print $2;}' | sort | uniq | xargs`

To Import

docker load -i ./services.tar
@AhmedKamal20
AhmedKamal20 / mass_fb_unfollow.js
Last active April 9, 2018 23:30
To Mass Unfollow Friends, Pages & Groups on Facebook
// Version: 0.2
// Author: Ahmed Kamal (AhmedKamal20)
// About : To Mass Unfollow Friends, Pages & Groups
// It'll Unfollow first ~250 (or more) from selected category
// It's kinda slow, but to avoid getting blocked by Facebook
// Usage :
// Open (News Feed Preferences) from the right menu
// Choose (Unfollow people to hide their posts)
// Select between All, Friends Only, Pages Only, Groups Only
// Then open the console and paste the following
@AhmedKamal20
AhmedKamal20 / subl_last_commit.sh
Created February 24, 2018 01:49
Open all modified files of the last commit with Sublime Text
git diff-tree --no-commit-id --name-only -r HEAD | xargs subl

Keybase proof

I hereby claim:

  • I am AhmedKamal20 on github.
  • I am akamal (https://keybase.io/akamal) on keybase.
  • I have a public key whose fingerprint is A662 97D2 9006 CEEE D5B8 7FF9 6CBE 3A72 0432 0A23

To claim this, I am signing this object:

@AhmedKamal20
AhmedKamal20 / sumyoutubeplaylist.js
Last active June 11, 2016 14:29
Get The Total Time of a Youtube Playlist
// Open You playlist
// Load all the videos in view
// Open The Console
var times = $x('//*[@id="pl-load-more-destination"]/tr/td[7]/div/div[1]/span');
var alltimes = new Array()
var timesec = new Array()
for (i = 0; i < times.length; i++) {
alltimes.push(times[i].innerHTML)
timesec.push(parseInt(alltimes[i].split(':')[0]*60) + parseInt(alltimes[i].split(':')[1]))
@AhmedKamal20
AhmedKamal20 / extract.js
Last active June 11, 2016 12:04
Extract Your Chrome Extensions Titles From The Console
// Open chrome://extensions/
// F12 >> The Console
var titles = document.querySelectorAll("h2.extension-title");
var myExtensions = new Array()
for (i = 0; i < titles.length; i++) {
myExtensions.push(titles[i].innerHTML)
}
myExtensions
@AhmedKamal20
AhmedKamal20 / ruby-rails.sh
Created February 17, 2016 15:06
Ruby(2.2.2) Rails(4.2.3) Installation Ubuntu(14.04)
# These are the suggested installation instructions for Ubuntu for class. There is
# lengthy compilation step in the middle of these procedures, so please plan on
# 30min break to complete the "rbenv install" command.
# The instructions start with a visit to the official Rails site (http://rubyonrails.org).
# The download page (http://rubyonrails.org/download/)
# recommends that we install the rbenv installation manager to manage our ruby installation
# and supplies a link to git://github.com/sstephenson/rbenv.git
# There are more words about the rbenv, ruby, and rails installation on the Ubuntu page
# https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04