echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
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 | |
PARAMATER="laravel-env" | |
REGION="eu-central-1" | |
WEB_DIR="/var/www/laravel" | |
WEB_USER="www-data" | |
# Get parameters and put it into .env file inside application root | |
aws ssm get-parameter --with-decryption --name $PARAMATER --region $REGION --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' -e 's/\\n/\n/g' -e 's/\\//g' > $WEB_DIR/.env |
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/sh | |
sudo yum update -y | |
sudo amazon-linux-extras install nginx1 php7.4 -y | |
sudo yum clean metadata | |
sudo yum install git mariadb-server php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip} -y | |
# Back up existing config | |
sudo cp -R /etc/nginx /etc/nginx-backup | |
sudo chmod -R 777 /var/log | |
sudo chown -R ec2-user:ec2-user /usr/share/nginx/html | |
echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/index.php |
This gist contains lists of modules available in
in AWS Lambda.
It also contains the code to run in Lambda to generate these lists. In addition there
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
1. Alpine (No need for redirection) | |
using the default cron utility (busybox) | |
## Dockerfile | |
===== | |
FROM alpine:3.7 | |
# Setting up crontab | |
COPY crontab /tmp/crontab |
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/sh | |
# Docs: https://dev.mysql.com/doc/mysql-repo-excerpt/8.0/en/linux-installation-yum-repo.html | |
# Install repo | |
wget https://dev.mysql.com/get/mysql80-community-release-el9-1.noarch.rpm | |
sudo dnf install mysql80-community-release-el9-1.noarch.rpm | |
# Verify enabled mysql80-community repo | |
sudo dnf repolist enabled |
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
# Check excution time in seconds | |
$start = microtime(true); | |
// Excute PHP scripts | |
echo "Total execution time in seconds: " . (microtime(true) - $start); | |
# Check memory usage in MiB | |
"Real RAM: ".(memory_get_peak_usage(true)/1024/1024)." MiB\n\n" |
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
There are two ways to efficiently (read: quickly) load 7000 rows. | |
LOAD DATA INFILE -- After you have built a 7000-line CSV file. | |
"Batch" INSERT -- like INSERT INTO t (a,b) VALUES (1,2),(5,6),(9,2), ...; -- Be cautious about the number of rows. 100 to 1000 is a good range of what to do at a time. | |
max_allowed_packet=536870912 -- NO, not in a tiny 2GB VM; change to 16M. Other likely settings to check: | |
key_buffer_size = 10M | |
innodb_buffer_pool_size = 1GB |
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
1. Convert timestamp to microsecond bigint: | |
SELECT EXTRACT(EPOCH FROM to_timestamp('20210311 09','yyyymmdd TZH'))::bigint | |
2. Covnert string to timestampt with timemodified timezone +9: | |
to_timestamp(timemodified) >= to_timestamp(''20210309000000 09'',''yyyymmddhh24miss TZH'') | |