Skip to content

Instantly share code, notes, and snippets.

View adeubank's full-sized avatar
🌳

Allen Eubank adeubank

🌳
View GitHub Profile
@adeubank
adeubank / ffmpg_gen_thumb.sh
Created November 27, 2021 20:31
Generate 1 thumbnail from a video at timestamp
ffmpeg -i input.mp4 -ss 00:00:00.000 -vframes 1 output.png
@adeubank
adeubank / aws-autoscaling-ec2-ssh-and-command.sh
Last active October 20, 2021 14:38
Boilerplate for running an ssh command across EC2 instances in an AutoScalingGroup. Check disk status on EC2 instances in an Autoscaling group name.
ASG_NAME=myautoscalinggroup
for ID in $(aws autoscaling describe-auto-scaling-instances --query 'AutoScalingInstances[?AutoScalingGroupName==`$ASG_NAME`].InstanceId' --output text);
do
IP=$(aws ec2 describe-instances --instance-ids $ID --query 'Reservations[].Instances[].PublicIpAddress' --output text)
ssh -q -o "StrictHostKeyChecking no" -i ec2.pem ec2-user@$IP 'echo $(hostname): $(df -h | grep /dev/nvme1n1)'
done
@adeubank
adeubank / mount_nvme1n1.sh
Created May 28, 2021 18:51
This script will make a filesystem and mount a nvme1n1 device and modify the /etc/fstab for remounts on reboot -
# This script will make a filesystem and mount the device and modify the /etc/fstab for remounts on reboot -
#!/bin/bash
if ( lsblk | fgrep -q nvme1n1 ); then
mkfs.ext4 /dev/nvme1n1
mkdir -p /ephemeral1
mount /dev/nvme1n1 /ephemeral1
@adeubank
adeubank / PostAdLibertasAudienceReportingWebhook.http
Last active May 20, 2021 22:51
An example AdLibertas API request to import an event into Audience Reporting. Reach out to your account manager for your Webhook URL and Authentication Token.
POST http://publicapi.adlibertas.com/v1/webhooks/events/12345_your_webhook_id
Authorization: Basic you_adlibertas_auth_token
Content-Type: application/json
{
"event": {
"id": "your_unique_event_id",
"event_date": "20210519",
"event_timestamp": 1621459749000000,
"event_name": "event_name_b637",
@adeubank
adeubank / config.properties
Last active March 29, 2021 22:21
Trino worker properties for r5.4xlarge instance cluster. These should be the same on the coordinator and worker. https://trino.io/docs/current/admin/properties.html
-Dexchange.client-threads=50
-Dexchange.concurrent-request-multiplier=16
-Dexchange.max-buffer-size=4GB
-Dexchange.max-response-size=512MB
-Dnode-scheduler.max-splits-per-node=1000
-Dnode-scheduler.max-pending-splits-per-task=50
-Dquery.max-memory=140GB
-Dshutdown.grace-period=45s
-Dsink.max-broadcast-buffer-size=2GB
-Dsink.max-buffer-size=1GB
ironsource inventory reports CSV file for 2020-01-14
can i process this file?
am i already processing an admob file?
am i processing a mopub config file?
download CSV file (FileImporter)
truncate stage table
@adeubank
adeubank / select_dates_between_two_dates.sql
Created September 4, 2018 15:32
Select all days between two dates
select * from
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3,
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v
where selected_date between '2018-07-01' and curdate()
@adeubank
adeubank / finding_sidekiq_jobs.rb
Created August 29, 2018 18:21
Deleting Sidekiq Jobs From Queue, Scheduled, and Retry
# find them in a queue
queue = Sidekiq::Queue.new("default")
jobs = queue.map do |job|
if job.klass == '[JOB_CLASS]'
{job_id: job.jid, job_klass: job.klass, arguments: job.args}
end
end.compact
# the retry queue
retries = Sidekiq::RetrySet.new.select
// find a game object in the active scene
using System.Linq;
GameObject worldGameObject =
GameObject.FindGameObjectsWithTag("World").ToList().Find(o => o.scene == activeScene);
if (worldGameObject != null)
{
Debug.Log("SetTrigger: SceneExit" + worldGameObject.name);
worldGameObject.GetComponent<Animator>().SetTrigger("SceneExit");
}
else
def my_fun
vals = []
(1..5).each do |i|
puts "my_fun i=#{i}"
begin
handle_catchable_errors do
vals << unsafe_fun(i)
end
rescue KnownError => e