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 | |
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 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 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 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 Droplet on DigitalOcean often, this is a cheatlist of commands that I use often. | |
Use my link https://m.do.co/t/b298d6966c0c (Discount code for newbies, I get some free referral credits too) to sign up and start playing. | |
--- Check your OS version | |
cat /etc/os-release | |
--- DigitalOcean Ubuntu 14.04 do-agent (monitoring) install | |
curl -L -o ./install.sh https://insights.nyc3.cdn.digitaloceanspaces.com/install.sh | |
sed -i '17s/https/http/' install.sh | |
chmod 775 install.sh |
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
-- 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 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
-- Automate your macOS a bit more, schedule Safari to open your favourite sites regularly at 7am to save a few seconds each morning. | |
# In terminal, type the following command which will allow you to edit current scheduled jobs with nano editor | |
# You might need to grant cron full disk access for this to work. https://osxdaily.com/2020/04/27/fix-cron-permissions-macos-full-disk-access/ | |
env EDITOR=nano crontab -e | |
# Then copy and paste the following lines. Control-X to exit nano. The new jobs will be schedulled. | |
# The samples below are to open Safari at 7am each morning with the specified URL. It should placed them in new tab if that's how your safari is setup. It's good to wake up each morning saving a few seconds loading the sites you read daily. You can also use similar schedule to download files, open apps, etc. To learn more about how to specify the time, check out http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/ | |
$ crontab -r where the -r flag removes current crontab configuration. |
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 "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 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 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 |