Skip to content

Instantly share code, notes, and snippets.

Avatar

Almir Mendes m3nd3s

View GitHub Profile
@m3nd3s
m3nd3s / shell.mkd
Last active Oct 24, 2018
Shell presentation
View shell.mkd

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

-> Shell Linux <-

-> Uma pequena talk sobre comandos shell <-


@m3nd3s
m3nd3s / prettycsv.sh
Created Mar 12, 2018
Console Pretty CSV
View prettycsv.sh
#!/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 Apr 12, 2017 — 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/
View nginx.conf
# 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 Nov 20, 2015
Coding Dojo Fizz Buzz
View fizz_buzz.rb
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 Oct 21, 2015 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
View yosemite ntfs read+write.txt
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
View secrets.yml
#config/secrets.yml
production:
secret_key_base: "173df1a20fb5d746d33695c5e22762a9fad1211d7321ad1cfa7c0ed53d540337"
@m3nd3s
m3nd3s / find_and_resize.sh
Created May 19, 2015
Find and Resize Images
View find_and_resize.sh
#!/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 Mar 24, 2015
Find and resize imagens on path
View find_and_resize.sh
#!/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 Mar 2, 2015
Conversor de timezone
View timezone.rb
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 Aug 29, 2015
Remote command
View command.sh
#!/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
You can’t perform that action at this time.