This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUCKETNAME=$1 | |
PROFILE=$2 | |
URL=$3 | |
aws s3 ls $BUCKETNAME/ --profile $PROFILE --endpoint-url=$URL | while read -r line; | |
do | |
createDate=`echo $line|awk {'print $1" "$2'}` | |
createDate=`date -d"$createDate" +%s` | |
olderThan=`date --date "15 days ago" +%s` | |
if [[ $createDate -lt $olderThan ]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#https://medium.com/@bn121rajesh/rsa-sign-and-verify-using-openssl-behind-the-scene-bf3cac0aade2 | |
openssl genrsa -out myprivate.pem 1024 | |
openssl rsa -in myprivate.pem -pubout > mypublic.pem | |
openssl dgst -sha1 -sign myprivate.pem -out sha1.sign toSign | |
openssl dgst -sha1 -verify mypublic.pem -signature sha1.sign toSign |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create 1GB swap file (change count if needed) | |
sudo dd if=/dev/zero of=/swapfile bs=1G count=1 | |
# Fix permissions | |
sudo chmod 600 /swapfile | |
# Make swap with given file | |
sudo mkswap /swapfile | |
# Enable swap | |
sudo swapon /swapfile | |
# Check Swap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from distutils.version import LooseVersion, StrictVersion | |
from argparse import ArgumentParser | |
import subprocess | |
parser = ArgumentParser() | |
parser.add_argument("-p", "--position", dest="position", | |
help="Position code. It can be numeric or a string: major, minor or patch", metavar="position") | |
args = parser.parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
from argparse import ArgumentParser | |
""" | |
A script to check a React Native view class and its stylesheet external file, removing unused style classes. | |
It search occurrences of given variable name (which must be the name of imported stylesheet class), comparing usages with | |
stylesheet class. | |
It eventually removes unused style classes from style file. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep ^www-data /etc/group | |
sudo adduser admin www-data | |
grep ^www-data /etc/group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (C) Christian Ascone - All Rights Reserved | |
@project $project.name | |
@file $file.fileName | |
@author Christian Ascone | |
@date $today |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "###########################" | |
echo $(date -u) "Starting rsync data" | |
eval `ssh-agent -s` | |
ssh-add ~/.ssh/key_name | |
rsync -vrahe ssh ~/www/local/data/upload ciolloadm@vps0228.00gate.com:/home/remote/dir | |
echo $(date -u) "Ended rsync data" | |
echo "###########################" |
NewerOlder