%title: Shell Linux %author: Almir Mendes %date: 2018-09-27
-> Uma pequena talk sobre comandos shell <-
#!/bin/bash | |
PATH=$PATH:/usr/bin:/bin:/usr/local/bin | |
while [ "$1" != "" ]; do | |
case $1 in | |
-s ) shift | |
SEPARATOR=$1 | |
;; | |
* ) FILEPATH=$1 |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
class FizzBuzz | |
attr_reader :lista | |
def initialize | |
@lista = 1..100 | |
end | |
def divisor_3_5 (numero) | |
if(numero%5 == 0 && numero%3 ==0) | |
"fizzbuzz" |
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" |
#!/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" |
#!/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" |
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') |
#!/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 |