This file contains hidden or 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
git remote set-url --add --push origin https://github.com/yuchdev/entropy_calculator.git | |
git remote set-url --add --push origin https://bitbucket.org/ycherkasov/entropy_calculator.git |
This file contains hidden or 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
$ git clone --mirror https://github.com/yuchdev/entropy_calculator.git | |
$ cd entropy_calculator.git | |
$ git push --mirror https://bitbucket.org/ycherkasov/entropy_calculator.git |
This file contains hidden or 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 | |
# Make sure you change the following variable | |
# to match the network interface you would like to monitor | |
nic=en0 | |
echo "CPU information:" | |
sysctl -n machdep.cpu.brand_string | |
# Find current bandwith in each pipe |
This file contains hidden or 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/sh | |
# Execute for every subdir | |
for dir in ~/projects/git/* | |
do | |
(cd $dir && git pull) | |
done | |
Find text | |
find / -type f -exec grep -H 'text-to-find-here' {} \; |
This file contains hidden or 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
sudo fsck -fvy /dev/sdb5 | tee ~/sdb5_results | |
# try -fvn |
This file contains hidden or 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 | |
/etc/init.d/syslogd stop | |
/etc/init.d/rsyslogd stop | |
sudo systemctl disable rsyslog | |
sudo systemctl disable syslog |
This file contains hidden or 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
sudo apt-get install sshpass | |
# $1: 1st command-line param, password | |
# $2: 2nd command-line param, username | |
# $3: 3rd command-line param, rsync source path | |
# $4: 4th command-line param, rsync destination path | |
/usr/bin/rsync -ratlz --rsh="/usr/bin/sshpass -p $1 ssh -o StrictHostKeyChecking=no -l $2" $3 $4 | |
# Alternatively, you can avoid the password prompt on rsync command |
This file contains hidden or 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 | |
# Method 1 | |
dd if=/dev/urandom of=/dev/null status=progress | |
# Method 2 | |
# You just need to enter a controlT character from the keyboard while the dd command is executing. | |
# By pressing the controlT character, you are sending the same SIGINFO signal to the dd command | |
# that the command pkill -INFO -x dd sends. |
This file contains hidden or 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
time python3 jira_backup.py | |
# Output | |
# real 0m1.542s | |
# user 0m0.299s | |
# sys 0m0.136s |
This file contains hidden or 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
class Shell: | |
def __init__(self, cd_path): | |
self.cd_path = cd_path | |
self.exit_path = os.getcwd() | |
def __enter__(self): | |
os.chdir(self.cd_path) | |
def __exit__(self): |
OlderNewer