Skip to content

Instantly share code, notes, and snippets.

waleed samy waleedsamy

Block or report user

Report or block waleedsamy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
waleedsamy /
Created Jul 26, 2018
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 /
Last active Jul 16, 2018
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 / Jenkinsfile
Created Oct 17, 2017
Jenkinsfile that extract git info, build multi-stage docker image, push to nexus and deploy to kubernetes
View Jenkinsfile
node {
def rock
def branch
def commit
def nexussrv = ""
def nexussrv_office = "${nexussrv}:8843"
def nexussrv_datacenter = "${nexussrv}:9843"
waleedsamy / Dockerfile
Created Oct 13, 2017
Run docker inside Jenkins container
View Dockerfile
From jenkins
USER root
RUN apt-get update && apt-get install -y vim nano zsh curl git sudo
waleedsamy /
Created Oct 2, 2017
update my mp3's to have only the artist information
l=Bob\ Marley
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 -l '{}' +
find "$d" -type f -iname "*.mp3" -exec id3tag --artist="$l" '{}' +
waleedsamy / bindasync.js
Created Aug 8, 2017
why bind async.js? because I can.
View bindasync.js
const async = require('async');
let ob = {
'x': 8,
'y': 16
function ci(callback) {
console.log('ci', this.x, this.y);
callback(null, 'berlin')
waleedsamy / git worktree
Created Aug 3, 2017
Run test for your project and continue working on the code in same time
View git worktree
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 / Function.scala
Created Aug 1, 2017
Function and PartialFunction Scala classes
View Function.scala
// func1 and func2 are synonyms
val func1 = (x: String) => "hello %s".format(x)
val func2 = new Function1[String, String] {
def apply(x: String) = "hello %s".format(x)
waleedsamy /
Created Jul 25, 2017
kubernetes rollout command in nutshell
#record revision with clear information
kubectl create -f xDeployment.yaml --record
# interactive command to get the status for a deployment, you can check it's result with $?
kubectl rollout status deploy/x
# show revisions
kubectl rollout history deploy/x
# details about revision 1
kubectl rollout history deploy/x --revision 1
#rollback to to previous version
kubectl rollout undo deploy/x
waleedsamy / grepchars
Created Jul 13, 2017
grep with 1 character before string and 6 character after
View grepchars
grep -E -o ".{0,1}string.{0,6}" afile
You can’t perform that action at this time.