Skip to content

Instantly share code, notes, and snippets.

@waleedsamy
waleedsamy / ublockorigin_drop_alle_Scheiße_von_Facebook.js
Last active February 3, 2022 08:55
uBlockOrigin filters for Facebook Stories, Rooms, Contacts, Birthdays and Ads
! No Stories, Rooms, Contacts, Birthdays and Ads
facebook.com##div[data-pagelet=Stories]
facebook.com##div[data-pagelet=VideoChatHomeUnit]
facebook.com##div[data-pagelet=RightRail]
facebook.com##div[data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"])
facebook.com##div[data-pagelet^="FeedUnit"]:has(:has-text(Suggested for You))
@waleedsamy
waleedsamy / Fix_SSL_unable_to_verify_the_first_certificate.md
Last active February 9, 2024 03:25
How to fix SSL unable to verify the first certificate

Open an ssl connection to site

openssl s_client -connect client-cert-missing.badssl.com:443

returns

.
.
.
---
@waleedsamy
waleedsamy / jmx-in-docker.md
Created July 26, 2018 16:33
Run java/jmx in docker container and use visaulvm to mointor your app

I was testing an application (parser.jar) and need to limit the resource used by the app (cpu/ram) and see how different implmenation behaves.

docker run --rm -p 9010:9010 -it --memory=3000MB --cpus="2" java:8-jdk bash -c " java \
      -server \
      -XX:+UseG1GC \
      -XX:+UseStringDeduplication \
      -XX:+ExitOnOutOfMemoryError \
 -Xmx2g \
@waleedsamy
waleedsamy / awk-add-nums.sh
Last active July 16, 2018 16:45
Use AWK to add numbers from two files
awk 'FNR==NR{a[NR]=$1;next}{ print $0 " + " a[FNR] " = " $0+a[FNR]}' total-time-317.log total-time-330.log
@waleedsamy
waleedsamy / Jenkinsfile
Created October 17, 2017 16:14
Jenkinsfile that extract git info, build multi-stage docker image, push to nexus and deploy to kubernetes
node {
def rock
def branch
def commit
def nexussrv = "nexus.example.de"
def nexussrv_office = "${nexussrv}:8843"
def nexussrv_datacenter = "${nexussrv}:9843"
@waleedsamy
waleedsamy / Dockerfile
Created October 13, 2017 11:27
Run docker inside Jenkins container
From jenkins
USER root
RUN apt-get update && apt-get install -y vim nano zsh curl git sudo
@waleedsamy
waleedsamy / artist.sh
Created October 2, 2017 14:38
update my mp3's to have only the artist information
l=Bob\ Marley
d=/songs/$l
find "$d" -type f -iname "*.mp3" -exec ls '{}' +
find "$d" -type f -iname "*.mp3" -exec mid3v2 -D '{}' +
find "$d" -type f -iname "*.mp3" -exec mid3v2 --delete-frames=TALB,TCON,TPE1,TDRC,TIT2,AENC,ASPI,COMM,COMR,ENCR,EQU2,ETCO,GEOB,GRID,LINK,MCDI,MLLT,OWNE,PRIV,PCNT,POPM,POSS,RBUF,RVA2,RVRB,SEEK,SIGN,SYLT,SYTC,TBPM,TCOM,TCOP,TDEN,TDLY,TDOR,TDRL,TDTG,TENC,TEXT,TFLT,TIPL,TIT3,TKEY,TLAN,TLEN,TMCL,TMED,TMOO,TOAL,TOFN,TOLY,TOPE,TOWN,TPE3,TPE4,TPOS,TPRO,TPUB,TRSN,TRSO,TSOA,TSOP,TSOT,TSRC,TSSE,TSST,TXXX,UFID,USER,USLT,WCOM,WCOP,WOAF,WOAR,WOAS,WORS,WPAY,WPUB,WXXX '{}' +
find "$d" -type f -iname "*.mp3" -exec mid3v2 -l '{}' +
find "$d" -type f -iname "*.mp3" -exec id3tag --artist="$l" '{}' +
@waleedsamy
waleedsamy / bindasync.js
Created August 8, 2017 15:28
why bind async.js? because I can.
const async = require('async');
let ob = {
'x': 8,
'y': 16
}
function ci(callback) {
console.log('ci', this.x, this.y);
callback(null, 'berlin')
@waleedsamy
waleedsamy / git worktree
Created August 3, 2017 08:16
Run test for your project and continue working on the code in same time
git worktree add -b run-test-for-fix-bug-x ../fix-bug-x origin/fix-bug-x
rm -rf ../fix-bug-x && git worktree prune
@waleedsamy
waleedsamy / Function.scala
Created August 1, 2017 13:39
Function and PartialFunction Scala classes
// func1 and func2 are synonyms
val func1 = (x: String) => "hello %s".format(x)
func1("world")
func1.apply("world")
val func2 = new Function1[String, String] {
def apply(x: String) = "hello %s".format(x)
}
func2("world")
func2.apply("world")