Skip to content

Instantly share code, notes, and snippets.

View kiriappeee's full-sized avatar

Adnan Issadeen kiriappeee

View GitHub Profile
@kiriappeee
kiriappeee / routes.yaml
Last active November 19, 2018 10:11
Blog Routes
routes:
/:
template: home
rss: true
/projects/all/:
controller: channel
filter: tag:primary-active-project,tag:primary-archived-project
template: blog
rss: true
@kiriappeee
kiriappeee / comparesha256local.sh
Last active September 5, 2018 06:47
Compare local file sha 256 with sha256 through stdin or through remote file
#!/bin/bash
# Usage: ./comparesha256.sh /path/to/local/file sha-copied-from-website
#
# Example: ./comparesha256.sh /usr/local/bin/go de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b
# Expected output will look like this:
#
# Files checksums match
#
#
@kiriappeee
kiriappeee / adhstory.py
Created April 12, 2018 09:38
A Diffie Helman Story. Alice and Bob meet a thief while exchanging keys
from Crypto.Util import number
from datetime import datetime
import time
p=int("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481
@kiriappeee
kiriappeee / encrypt.py
Last active March 29, 2018 04:50
Learning encryption
from Crypto.PublicKey import RSA
key=RSA.generate(2048)
privateKey=key.publickey().exportKey(format='PEM')
f=open('encryption.pem.pub', 'wb')
f.write(privateKey)
f.close()
publicKey=key.exportKey(format='PEM')
@kiriappeee
kiriappeee / extractdockerservices.sh
Created February 16, 2018 23:25
Extracting docker services to be run from a complex docker-compose command
#!/bin/bash
function getLinkedServices(){
IFS=
serviceToCheck=$1
serviceDefintion=$(echo $finalDockerFile | grep "^\s\s$serviceToCheck:" -A $lengthOfDockerFile -m 1)
nextServiceLine=$(echo $serviceDefintion | tail -n +2 | grep "^\s\s[a-zA-Z0-9]\+:" -m 1 -n | awk '{print $1}')
if [ "$nextServiceLine" != "" ]
then
nextServiceLine=${nextServiceLine:0:-1}
else
@kiriappeee
kiriappeee / removesectionsfromyoutube.js
Created January 16, 2018 09:15
Remove various sections from the YouTube interface
/*Remove videos from subscription that are older than a day*/
function removeOldSubbedVideos(){
subbedVideoList=document.querySelectorAll('ytd-item-section-renderer.style-scope.ytd-section-list-renderer');
for(var i=1;i<subbedVideoList.length;i++){
subbedVideoList[i].remove()
}
}
/*remove trending button*/
function removeTrendingButton(){
@kiriappeee
kiriappeee / removeyoutuberecommends.js
Created January 16, 2018 08:23
Remove youtube recommendations
function sleep(ms){
return new Promise(resolve => setTimeout(resolve, ms));
}
async function removeRecommendations(){
var notInterestedButtons = document.querySelectorAll('button#button[aria-label="Not interested"]');
for(var i=0; i<notInterestedButtons.length; i++){
notInterestedButtons[i].click();
sleep((Math.random()*1000)+1000);
}
@kiriappeee
kiriappeee / unfolloweveryonefb.js
Last active November 18, 2019 07:11
Unfollow friends fb
//a script to unfollow everyone on fb
//copy everything below into the console and when you are ready,
//type unfollowEveryone(); into the JS console and hit enter.
//Not going to include actually running the command in this script.
//Running the script is ultimately your choice, and I bear no responsibility
//for this script unfollowing all pages, friends, groups, etc that you follow
//on FB and I make no guarantees about its correctness beyond saying
//it worked for me.
function sleep(ms){
@kiriappeee
kiriappeee / removeextratweets.js
Last active September 11, 2022 19:49
Remove all the extra tweets that twitter puts into your timeline including ads and likes
/*To use this function, open up Twitter, open a console in dev mode,
paste the function in below, and then run,
var intervalId = window.setInterval(removeGarbage, 1000);
if you wish to stop this removing all the extra tweets every second,
window.clearInterval(intervalId);
*/
function removeGarbage(){
var tweets=document.querySelectorAll('.js-stream-item.stream-item.stream-item');
var tweetsToRemove=Array();
for (var i=0; i<tweets.length; i++){