Skip to content

Instantly share code, notes, and snippets.

@shyam
shyam / ffencode.txt
Created January 16, 2021 17:07 — forked from jemekite/ffencode.txt
ffmpeg preserve metadata
ffmpeg -i input.mp4 -vcodec h264 -acodec aac -map_metadata 0 output.mp4
@shyam
shyam / aws-cf-logs
Last active October 9, 2020 15:15 — forked from shapeshed/aws-cf-logs
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
#!/usr/bin/env bash
BUCKET=$1
CWD=$(pwd)
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz
@shyam
shyam / helloworld-deployment-and-service.yml
Created June 14, 2018 07:43
k8s - test deployment, service and nginx ingress
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: helloworld-deployment
spec:
selector:
matchLabels:
app: helloworld
replicas: 4
--- branches/ruby_2_3/thread.c 2017/04/09 11:53:53 58288
+++ branches/ruby_2_3/thread.c 2017/04/09 13:26:01 58289
@@ -2187,6 +2187,12 @@
return busy;
}
+void
+rb_thread_fd_close(int fd)
+{
+ while (rb_notify_fd_close(fd));
@shyam
shyam / postgres_queries_and_commands.sql
Created July 21, 2016 05:44 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
(ffr@ffr:mysql [master] ❷ ->0)$ cat /usr/local/opt/mysql/my.cnf
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,ALLOW_INVALID_DATES
@shyam
shyam / nginx
Created May 22, 2012 10:29
Nginx init script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
@shyam
shyam / gist:1940844
Created February 29, 2012 13:30 — forked from lelayf/gist:1929949
Procedure for installing and setting Sun JDK Java 6 on Amazon Linux AMI 64bit
# Get latest Sun Java SDK in v6 from Oracle
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin
# make it exec
chmod +x jdk-6u31-linux-x64-rpm.bin
# Install Java
sudo ./jdk-6u31-linux-x64-rpm.bin
# Check if the default java version is set to sun jdk
@shyam
shyam / compile-ooo3.sh
Created October 7, 2011 08:44
comping OpenOffice.org3 3.3.0 for headless mode operations ( like watermarking, pdf processing, etc., )
# tested on an EL5/EL6 based platform
cd ~
yum -y install perl-Archive-Zip ant flex pam-devel cups-devel gperf libxslt-devel openldap-devel gstreamer-devel gstreamer-plugins-base-devel db4-devel unixODBC-devel xalan-j2 boost-devel unixODBC-devel qt-devel subversion autoconf automake gtk2-devel gcc-c++ gnome-vfs2-devel rpm-build expat-devel python-devel curl-devel gcc gcc-c++ java-1.6.0-openjdk-devel libIDL-devel libXaw-devel bison libX11-devel libXrender-devel libXrandr-devel screen
wget https://raw.github.com/gist/1247669/88133c7c8da53d257c38ff73b161d116aed18c13/dot-screenrc -O ~/.screenrc
screen
wget http://download.services.openoffice.org/files/stable/3.3.0/OOo_3.3.0_src_core.tar.bz2
wget http://download.services.openoffice.org/files/stable/3.3.0/OOo_3.3.0_src_system.tar.bz2
@shyam
shyam / dot-screenrc
Created September 28, 2011 11:05
screenrc file ( author - anonmymous )
### I got tired of .screenrc's on the internet being so
### poorly commented... So being a good GNUbie I took matters
### into my own hands; and wrote this dotfile.
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #
## Explanation of hardstatus line ##
# Ignore the ' marks if you use these examples for yourself