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
@uilian
uilian / sample-imagemagick-base64.sh
Created Aug 8, 2019
Imagemagick manipulation with base64 images
View sample-imagemagick-base64.sh
# create a new image
$ convert -size 10x10 xc:red sample.jpg
# convert to a base64 string
$ base64 sample.jpg
# output to a file:
$ convert 'inline:data:image/jpeg;base64,[BASE64-DATA]' output.jpg
# or, output to a base64 string:
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
uilian / replace-text-in-files.sh
Created May 15, 2019
Find all files containing some text, then replace by something else
View replace-text-in-files.sh
ag -l "TEXT_TO_FIND" . | xargs sed -i.bak 's/TEXT_TO_FIND/NEW_TEXT_TO_REPLACE/g'
@uilian
uilian / rename.sh
Created Apr 15, 2019
Multi-rename files
View rename.sh
# 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
uilian / find-process.sh
Created Mar 26, 2019
Find process occupying port
View find-process.sh
## this
netstat -vanp tcp|grep PORT
## or this, if -p is not supported
lsof -i tcp:PORT
@uilian
uilian / docker-commands.md
Last active Jan 16, 2019
More docker commands
View docker-commands.md

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
uilian / diff-dirs.sh
Created Aug 7, 2018
Diff between two directories
View diff-dirs.sh
diff -r ~/projects/sim-api/ ~/projects/onboarding/sim-api/ | grep ~/projects/sim-api/ | awk '{print $4}' > difference.txt
View Suse - auto start Websphere 8.5.5 Liberty
////// was8 file on /etc/init.d
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: was8
# Required-Start:
# Should-Start: $ALL
# Required-Stop:
# Should-Stop:
@uilian
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
select
owner,
sum(bytes)/1024/1024/1024 schema_size_gig
from
dba_segments
group by
owner;
-- Tamanho por tipo de objeto
@uilian
uilian / oracle-spatial-google-projection.sql
Created May 20, 2014
Oracle Spatial add Google SRID conversion capability
View oracle-spatial-google-projection.sql
------------------------------------------------
-- OPTIONAL STEPS
-- Adding Ellipsoid
INSERT INTO MDSYS.SDO_ELLIPSOIDS (
ELLIPSOID_ID,
ELLIPSOID_NAME,
SEMI_MAJOR_AXIS,
UOM_ID,
INV_FLATTENING,
SEMI_MINOR_AXIS,
You can’t perform that action at this time.