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 | |
| start_time="$(date -u +%s)" | |
| sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list | |
| apt-get update | |
| apt-get -y install build-essential autoconf libtool git-core cmake | |
| apt-get -y build-dep imagemagick libmagickcore-dev libde265 libheif | |
| cd /usr/src/ | |
| git clone https://github.com/strukturag/libde265.git | |
| git clone https://github.com/strukturag/libheif.git | |
| cd libde265/ |
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
| Step 1: Get a bot id and keys | |
| Add botfather to your telegram account. Follow the interactive mode to choose the id, and you will get key (sample below, use your own key!). | |
| https://t.me/botfather | |
| ------ | |
| Done! Congratulations on your new bot. You will find it at t.me/sample_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this. | |
| Use this token to access the HTTP API: | |
| 1338113001:AALZqz4svWKBGeGehAnU1hgHUnYmpmUCpEk | |
| Keep your token secure and store it safely, it can be used by anyone to control your bot. |
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
| ╔══════╦════════════╦═══════════════╦══════════╦════════════════════════╦══════╗ | |
| ║ Node ║ Zookeeper ║ Kafka ║ Orderer ║ Peer ║ Cli ║ | |
| ╠══════╬════════════╬═══════════════╬══════════╬════════════════════════╬══════╣ | |
| ║ 1 ║ zookeeper0 ║ kafka0 kafka1 ║ orderer0 ║ peer0.org1.example.com ║ cli0 ║ | |
| ║ 2 ║ ║ ║ ║ peer1.org1.example.com ║ cli1 ║ | |
| ║ 3 ║ ║ ║ ║ peer2.org1.example.com ║ cli2 ║ | |
| ╚══════╩════════════╩═══════════════╩══════════╩════════════════════════╩══════╝ |
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
| I use Ubuntu 18.04 and 20.04 Droplets on DigitalOcean often. This is a cheatlist of commands used frequently. | |
| Sign up with https://m.do.co/t/b298d6966c0c (Discount code for newbies, I get referral credits too) | |
| -- System Information -- | |
| Check OS version: | |
| cat /etc/os-release | |
| Check kernel version: |
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
| -- Before uploading photos to Flickr, I use the following command to update copyright notice of all my images with EXIFTOOL http://owl.phy.queensu.ca/~phil/exiftool/ | |
| exiftool -r -m -P -overwrite_original_in_place -artist="OnDemandWorld 点应科技" -copyright="2009-2021 OnDemandWorld" -usercomment="Copyright © 2009-2021 OnDemandWorld 点应科技 OnDemandWorld.com" <Path> |
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
| -- Automation & Scheduling -- | |
| Classic Cron: | |
| In terminal, type: | |
| env EDITOR=nano crontab -e | |
| To remove all scheduled jobs: crontab -r | |
| To list all scheduled jobs: crontab -l | |
| Sample to open Safari every morning: | |
| 0 7 * * * open -a Safari http://www.bbc.com/news | |
| 0 7 * * * open -a Safari http://money.cnn.com |
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 | |
| # | |
| echo "Start Script" | |
| rm combined.pdf | |
| for file in *.pdf ; do pdftk "$file" cat 1 output "${file%.pdf}-page1.pdf" ; done | |
| pdftk *-page1.pdf cat output combined.pdf | |
| #for file in *.pdf ; do gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="${file%.pdf}-page1.pdf" -dFirstPage=1 -dLastPage=1 "$file" ; done | |
| #gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite -sOutputFile#"combined.pdf" *-page1.pdf |
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 | |
| # `autoingestion.sh` downloads Apple iOS App Store sales data. It will | |
| # download it to the same folder the script is running from, and group | |
| # the downloaded files into directories by report type. | |
| # | |
| # It will only attempt to download if new sales data should be | |
| # available. | |
| # | |
| # As skipping already downloaded files depends on the filename pattern |
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
| tell application "System Preferences" | |
| activate | |
| reveal anchor "TTS" of pane "com.apple.preference.speech" | |
| end tell | |
| tell application "System Events" to tell process "System Preferences" | |
| tell pop up button 1 of tab group 1 of window 1 | |
| click | |
| delay 0.5 -- without this the value was sometimes "Loading Voices…" | |
| if value is "Daniel" then | |
| click menu item "Ting-Ting" of menu 1 |