Skip to content

Instantly share code, notes, and snippets.

Uilian Souza uilian

Block or report user

Report or block uilian

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
View acrnms.txt
AFAIK =» As Far As I Know
AFK =» Away From Keyboard
ASAP =» As Soon As Possible
BAS =» Big A$$ Smile
BBL =» Be Back Later
uilian /
Created May 15, 2019
Find all files containing some text, then replace by something else
ag -l "TEXT_TO_FIND" . | xargs sed -i.bak 's/TEXT_TO_FIND/NEW_TEXT_TO_REPLACE/g'
uilian /
Created Apr 15, 2019
Multi-rename files
# Assembles the old and new names, in the following example the name has 3 parts
# The NR adds a linenumber to the new name.
s ls pattern_file_name* | awk '{print "mv " $1"\\ "$2"\\ "$3" " $1 NR $3 }' | bash $1
uilian /
Created Mar 26, 2019
Find process occupying port
## this
netstat -vanp tcp|grep PORT
## or this, if -p is not supported
lsof -i tcp:PORT
uilian /
Last active Jan 16, 2019
More docker commands

Removes all containers returned by condition

docker container rm $(docker container ps -qa --filter "name=example1" --filter "name=example2")

Removes images older than specified 'ImageID' and not tagged

docker image rm $(docker images -q --filter "dangling=true" --filter "before=ImageID")
uilian /
Created Aug 7, 2018
Diff between two directories
diff -r ~/projects/sim-api/ ~/projects/onboarding/sim-api/ | grep ~/projects/sim-api/ | awk '{print $4}' > difference.txt
uilian / oracle-schema-objects-size.sql
Created Apr 26, 2018
Tamanho dos objetos em um schema oracle
View oracle-schema-objects-size.sql
-- Todos os objetos do schema
sum(bytes)/1024/1024/1024 schema_size_gig
group by
-- Tamanho por tipo de objeto
uilian /
Created Jan 26, 2018
Remove unused docker objects
#remove stoped containers
docker rm $(docker ps -a -q)
# remove images without references
docker rmi $(docker images -f "dangling=true" -q)
# remove volumes without references
docker volume rm $(docker volume ls -qf dangling=true)
uilian / docker-compose.yml
Created Jan 24, 2018
docker-compose nginx
View docker-compose.yml
version: '2'
image: nginx:stable-alpine
- ./code:/usr/share/nginx/html
- "8080:80"
uilian / python-server
Created Jan 23, 2018
Python as a HTTP server
View python-server
# Python has a HTTP server built into the
# standard library. This is super handy for
# previewing websites.
# Python 3.x
$ python3 -m http.server
# Python 2.x
$ python -m SimpleHTTPServer 8000
You can’t perform that action at this time.