sh curl - curl wget不验证证书进行https请求

curl wget不验证证书进行https请求

curl_wget_no-check-ssl.sh
wget 'https://x.x.x.x/get_ips' --no-check-certificate

curl 'https://x.x.x.x/get_ips' -k

sh 有时你只想说他妈的EM!

有时你只想说他妈的EM!

kill-all-android-procs.sh
#!/data/user/0/com.sonelli.juicessh/files/bin/arm/pie/bash

procs=$(ps)
lines=($procs)
total=${#lines[@]}
counter=0

ps | while read -r line; do
    
    arr=($line)
    pid="${arr[1]}"
    
    echo "Killing PID $pid ($counter/$total)"
    pkill -l 9 $pid
    
    ((counter++))
    
done

sh 根据coinmarketcap.com发现最佳和最差的加密货币执行者

根据coinmarketcap.com发现最佳和最差的加密货币执行者

coin-performers.sh
#!/bin/bash

# coin-performers.sh
# finds best and worst cryptocurrency performers according to coinmarketcap.com
# quick hacky bash script could use refactoring into Python or something...

window=${1:-"[1-9]+[dh]"}
now=$(date +%s)

# cache the top 100
curl -s "https://api.coinmarketcap.com/v1/ticker/" | jq '.[]' > /tmp/coinz-$now.json
echo 'curl -s "https://api.coinmarketcap.com/v1/ticker/" | grep $1' " # ($window)"

# find best and worst
best=$(egrep "percent_change_${window}\": ?\"[0-9]{1,3}" /tmp/coinz-$now.json \
     | egrep -o '[0-9]{1,5}\.[0-9]{1,2}' | sort -rn | head -n1)
worst=$(egrep "percent_change_${window}\": ?\"-?[0-9]{1}" /tmp/coinz-$now.json \
     |  egrep -o '\-?[0-9]{1,5}\.[0-9]{1,2}' | sort -n | head -n1)
echo "best: $best and worst: $worst (percent) as of $now" | egrep "$best|$worst" --color

# record details on best and worst
# jq . -c /tmp/coinz-$now.json | egrep "\"$best\"|\"$worst\"" | jq .
jq . -c /tmp/coinz-$now.json | egrep "\"$best\""  | jq . > /tmp/coinz-$now-best
jq . -c /tmp/coinz-$now.json | egrep "\"$worst\"" | jq . > /tmp/coinz-$now-worst
best_id=$(jq .id --raw-output /tmp/coinz-$now-best)
worst_id=$(jq .id --raw-output /tmp/coinz-$now-worst)
best_name=$(jq .name /tmp/coinz-$now-best)
worst_name=$(jq .name /tmp/coinz-$now-worst)
best_symbol=$(jq .symbol /tmp/coinz-$now-best)
worst_symbol=$(jq .symbol /tmp/coinz-$now-worst)

# compare details on best and worst
diff -y /tmp/coinz-$now-best /tmp/coinz-$now-worst --width=80 \
     | egrep "$best|$worst|$best_name|$worst_name|$best_symbol|$worst_symbol" -C8 --color=always \
     | egrep '^ ' | sort | uniq

# clickable links

echo "https://coinmarketcap.com/currencies/$best_id/"
echo "https://coinmarketcap.com/currencies/$worst_id/"

# $ topGrowth=$(curl -s "https://api.coinmarketcap.com/v1/ticker/" | egrep 'percent_change_[1-9]+[dh]": ?"[0-9]{3}' | egrep -o '[0-9]{3,5}\...' | sort -rn | head -n1) ; echo $topGrowth
# $ botGrowth=$(curl -s "https://api.coinmarketcap.com/v1/ticker/" | egrep 'percent_change_[1-9]+[dh]": ?"-?[0-9]{1}' | egrep -o '\-?[0-9]{1,5}\...' | sort -n | head -n1) ; echo $botGrowth
# $ curl -s "https://api.coinmarketcap.com/v1/ticker/" | jq '.[]' -c | egrep "$topGrowth|$botGrowth|RPX" | jq .

sh 使用graphicsmagick返回照片的exif数据

使用graphicsmagick返回照片的exif数据

cmd.sh
# return all EXIF data present
gm identify -format '%[EXIF:*]' <file.jpg>

# return photo orientation
# unknown: landscape 0°
# 1: landscape 0° LeftTop
# 8: portrait -90° LeftBottom
# 3: landscape 180° RightBottom
# 6: portrait 90° RightTop
gm identify -format '%[EXIF:Orientation]' <file.jpg>

sh Mac终端命令

杀死进程.sh
sudo kill -9 716
查看指定端口.sh
sudo lsof -i :9000

sh 终端rsync bx

终端rsync bx

rsync.sh
sudo rsync -zarP -e "ssh -p PORT" LOGIN@HOST:PATH_TO_ROOT/ --exclude={bitrix/backup/*,bitrix/cache/*,bitrix/managed_cache/*,upload/resize_cache/*,upload/tmp/*,robots.txt,bitrix/.settings.php,bitrix/php_interface/dbconn.php,.last_modified/*,last_modified/*} /var/www/projects/LOCAL_SITE_NAME/.site/www/

sh 在linux中使用权限挂载cifs

在linux中使用权限挂载cifs

mount-smb
sudo mount -t cifs -o username=xxxxxxx,file_mode=0777,dir_mode=0777 //192.168.1.xxx/smb /mnt/windows/

sh shgist测试

echo.sh
#!/bin/bash
echo "$0";
exit 0;

sh PhpStorm.php

PhpStorm.php
########################### XDEBUG
[Xdebug]
zend_extension="/usr/lib/php/20170718/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
xdebug.max_nesting_level = 512
xdebug.file_link_format = phpstorm://open?%f:%l
;xdebug.profiler_enable = 1;
xdebug.profiler_enable_trigger = 1;
xdebug.profiler_output_dir = "/media/dados/web/xdebug_profiler"

$ sudo apt install php7.3-xdebug
$ locate xdebug.so
$ sudo phpenmod xdebug

########################### Instalar no navegador para ativar o profiler
https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc

########################### Instalando o Webgrind
https://easyengine.io/tutorials/php/xdebug-webgrind

########################## Pacote para o linux kcachegrind 
kcachegrind

########################### Language Portugues (Spelling)
https://github.com/rafaelsc/IntelliJ.Portuguese.Brazil.Dictionary

########################### Color Shema Atom
https://github.com/jesusOmar/one-dark-phpstorm

########################### PHP Class
<?php
#parse("PHP File Header.php")

declare(strict_types=1);
#if (${NAMESPACE})

namespace ${NAMESPACE};#end


/**
 * 
 *
#if (${NAMESPACE}) * @package ${NAMESPACE}
#end
@date   ${DATE} ${TIME}
 *
 * @author Fernando Petry <fernando.petry@autoavaliar.com.br>
 */
class ${NAME} {

}

   
############################# PHP Interface
   
   <?php
#parse("PHP File Header.php")

declare(strict_types=1);
#if (${NAMESPACE})

namespace ${NAMESPACE};#end


/**
 * 
 *
#if (${NAMESPACE}) * @package ${NAMESPACE}
#end
@date   ${DATE} ${TIME}
 *
 * @author Fernando Petry <fernando.petry@autoavaliar.com.br>
 */
interface ${NAME} {

}


############################ PHPUNIT TEST
<?php

#if (${NAMESPACE})
namespace ${NAMESPACE};
#end

#if (${TESTED_NAME} && ${NAMESPACE} && !${TESTED_NAMESPACE})
use ${TESTED_NAME};
#elseif (${TESTED_NAME} && ${TESTED_NAMESPACE} && ${NAMESPACE} != ${TESTED_NAMESPACE})
use ${TESTED_NAMESPACE}\\${TESTED_NAME};
#end
use PHPUnit\Framework\TestCase;

class ${NAME} extends TestCase {

}


#################### Fernando Petry.xml

<code_scheme name="Fernando Petry" version="173">
  <option name="SOFT_MARGINS" value="80" />
  <HTMLCodeStyleSettings>
    <option name="HTML_ATTRIBUTE_WRAP" value="0" />
    <option name="HTML_TEXT_WRAP" value="0" />
    <option name="HTML_ENFORCE_QUOTES" value="true" />
  </HTMLCodeStyleSettings>
  <PHPCodeStyleSettings>
    <option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
    <option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
    <option name="ALIGN_PHPDOC_COMMENTS" value="true" />
    <option name="ALIGN_ASSIGNMENTS" value="true" />
    <option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
    <option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
    <option name="PHPDOC_WRAP_LONG_LINES" value="true" />
    <option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
    <option name="ALIGN_CLASS_CONSTANTS" value="true" />
    <option name="SPACE_BETWEEN_TERNARY_QUEST_AND_COLON" value="true" />
    <option name="SPACE_BEFORE_COLON_IN_RETURN_TYPE" value="true" />
    <option name="PHPDOC_USE_FQCN" value="true" />
  </PHPCodeStyleSettings>
  <codeStyleSettings language="HTML">
    <option name="RIGHT_MARGIN" value="120" />
  </codeStyleSettings>
  <codeStyleSettings language="PHP">
    <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
    <option name="BLANK_LINES_AFTER_PACKAGE" value="1" />
    <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
    <option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
    <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
    <option name="ALIGN_GROUP_FIELD_DECLARATIONS" value="true" />
    <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
    <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
    <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
    <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
    <option name="PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE" value="true" />
  </codeStyleSettings>
</code_scheme>
profile.sh
#!/bin/bash

echo "========================================================="
echo "O que deseja fazer:"
echo "========================================================="
echo "1 = Ativar o profiler"
echo "2 = Desativar o profiler"
echo "3 = Limpar log"
echo "========================================================="
read action

if [ ${action} = 1 ]
then
sudo sed -i 's/^;xdebug.profiler_enable = 1;/xdebug.profiler_enable = 1;/g' /etc/php/7.2/apache2/php.ini
sudo sed -i 's/^xdebug.profiler_enable_trigger = 1;/;xdebug.profiler_enable_trigger = 1;/g' /etc/php/7.2/apache2/php.ini
sudo service apache2 restart
echo "Profiler ativado"
fi

if [ ${action} = 2 ]
then
sudo sed -i 's/^xdebug.profiler_enable = 1;/;xdebug.profiler_enable = 1;/g' /etc/php/7.2/apache2/php.ini
sudo sed -i 's/^;xdebug.profiler_enable_trigger = 1;/xdebug.profiler_enable_trigger = 1;/g' /etc/php/7.2/apache2/php.ini
sudo service apache2 restart
echo "Profiler desativado"
fi

if [ ${action} = 3 ]
then
rm /media/dados/web/xdebug_profiler/cachegrind.out*
echo "Log removido com sucesso"
fi

sh expo构建android

expo构建android

expo build android
#Android
exp build:android
exp ba

#iOS
exp build:ios
exp bi

#Status
exp build:status
exp bs