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
sudo apt-get install xz-utils | |
wget -O- https://telegram.org/dl/desktop/linux | sudo tar xJ -C /opt/ | |
sudo ln -s /opt/Telegram/Telegram /usr/local/bin/telegram-desktop |
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
// Demonstration video can be found at: https://youtu.be/roAerKVfq-Y | |
// StopEC2Instance | |
const AWS = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const ec2 = new AWS.EC2({ region: event.instanceRegion }); | |
ec2.stopInstances({ InstanceIds: [event.instanceId] }).promise() |
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
<?php | |
class CdnWPFC{ | |
public static function cloudflare_clear_cache($email = false, $key = false, $zoneid = false){ | |
if(!$email && !$key && !$zoneid){ | |
if($cdn_values = get_option("WpFastestCacheCDN")){ | |
$std_obj = json_decode($cdn_values); | |
foreach ($std_obj as $key => $value) { | |
if($value->id == "cloudflare"){ | |
$email = $value->cdnurl; |
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 time | |
import boto3 | |
transcribe = boto3.client('transcribe' , region_name='us-west-2',aws_access_key_id='ACCESS_KEY_ID',aws_secret_access_key='SECRET') | |
transcribe.start_transcription_job( | |
TranscriptionJobName='RandallTest1', | |
Media={ | |
'MediaFileUri': 'https://s3-us-west-2.amazonaws.com/randhunt-transcribe-demos/test.flac' | |
}, | |
MediaFormat='flac', | |
LanguageCode='en-US', |
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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.common.exceptions import TimeoutException, NoSuchElementException | |
from selenium.webdriver.common.keys import Keys | |
from parsel import Selector | |
from time import sleep | |
import requests, json | |
import time |
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
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from selenium.common.exceptions import TimeoutException, NoSuchElementException | |
from selenium.webdriver.common.keys import Keys | |
from parsel import Selector | |
from time import sleep | |
import requests, json | |
import time |
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
bootscript=/root/run.sh | |
servicename=customboot | |
cat > $bootscript <<EOF | |
#!/usr/bin/env bash | |
echo "$bootscript ran at $(date)!" > /tmp/it-works | |
EOF | |
chmod +x $bootscript |
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
server { | |
listen 80 default_server; | |
root /var/www/html; | |
index index.php index.html index.htm index.nginx-debian.html; | |
server_name _; | |
location / { | |
try_files $uri $uri/ =404; | |
} |
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
# install doctl | |
sudo apt update | |
sudo apt -y install snapd | |
sudo snap install doctl | |
ln -s /snap/bin/doctl /usr/local/bin | |
# initiate doctl | |
# Generate access token herer https://cloud.digitalocean.com/account/api/tokens | |
doctl auth init | |
# list current droplets in json format | |
doctl compute droplet list -o json |
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
ffmpeg -i intro.mp4 -i overlay.png \ | |
-filter_complex "[1:v]scale=520:-1,format=rgba,colorchannelmixer=aa=0.5[fg];[0][fg]overlay=1380:920:enable='between(t,0,20)'" \ | |
-pix_fmt yuv420p -c:v libx264 -preset fast -crf 22 -c:a libmp3lame \ | |
output.mp4 | |
ffmpeg -i intro.mp4 -i overlay.png \ | |
-filter_complex "[1:v]format=rgba,colorchannelmixer=aa=0.7[fg];[0][fg]overlay" \ | |
-pix_fmt yuv420p -c:a copy \ | |
output.mp4 |