Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View m3nd3s's full-sized avatar

Almir Mendes m3nd3s

View GitHub Profile
@m3nd3s
m3nd3s / shell.mkd
Last active October 24, 2018 17:14
Shell presentation

%title: Shell Linux %author: Almir Mendes %date: 2018-09-27

-> Shell Linux <-

-> Uma pequena talk sobre comandos shell <-


@m3nd3s
m3nd3s / prettycsv.sh
Created March 12, 2018 20:05
Console Pretty CSV
#!/bin/bash
PATH=$PATH:/usr/bin:/bin:/usr/local/bin
while [ "$1" != "" ]; do
case $1 in
-s ) shift
SEPARATOR=$1
;;
* ) FILEPATH=$1
@m3nd3s
m3nd3s / nginx.conf
Created April 12, 2017 20:17 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@m3nd3s
m3nd3s / fizz_buzz.rb
Created November 20, 2015 12:41
Coding Dojo Fizz Buzz
class FizzBuzz
attr_reader :lista
def initialize
@lista = 1..100
end
def divisor_3_5 (numero)
if(numero%5 == 0 && numero%3 ==0)
"fizzbuzz"
@m3nd3s
m3nd3s / yosemite ntfs read+write.txt
Created October 21, 2015 21:51 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
#config/secrets.yml
production:
secret_key_base: "173df1a20fb5d746d33695c5e22762a9fad1211d7321ad1cfa7c0ed53d540337"
@m3nd3s
m3nd3s / find_and_resize.sh
Created May 19, 2015 16:54
Find and Resize Images
#!/bin/bash
set -e
for F in $(find . -size +900k)
do
FNAME=`basename $F`
mv "$F" "$F-orig"
echo -n "Converting ${FNAME}: "
convert -strip -quality 80 -resize "1024x768>" "$F-orig" "$F"
echo "done"
@m3nd3s
m3nd3s / find_and_resize.sh
Created March 24, 2015 13:30
Find and resize imagens on path
#!/bin/bash
set -e
for F in $(find . -size +900k)
do
FNAME=`basename $F`
mv "$F" "$F-orig"
echo -n "Converting ${FNAME}: "
convert -strip -quality 80 -resize "1024x768>" "$F-orig" "$F"
echo "done"
@m3nd3s
m3nd3s / timezone.rb
Created March 2, 2015 18:01
Conversor de timezone
file = File.new("/Users/m3nd3s/Desktop/schedule.txt", 'r')
begin
report = File.open("/Users/m3nd3s/Desktop/report.txt", 'w')
while(line = file.gets)
cols = line.split(" - ")
utc_time = DateTime.parse(cols[0])
br_time = utc_time.in_time_zone('Brasilia')
@m3nd3s
m3nd3s / command.sh
Last active August 29, 2015 14:10
Remote command
#!/bin/bash
HOSTS=$(cat <<EOF
dev.adena.com.br
dev.acimaq.adena.com.br
EOF)
CMD="ls -lah /proc/\$(pidof java)/task | wc -l"
for H in $HOSTS