Skip to content

Instantly share code, notes, and snippets.

Y teebu

Block or report user

Report or block teebu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View youtube-dl-download-audio-only-on-best-quality.md

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@teebu
teebu / Output Android Icons.jsx
Created Mar 2, 2019 — forked from Gamezpedia/Output Android Icons.jsx
Photoshop script to output Android icons (with XXXHDPI, XXHDPI, XHDPI, HDPI, MDPI support)
View Output Android Icons.jsx
// Output Android Icons.jsx
// 2012 Todd Linkner
// License: none (public domain)
// v1.0 - base file by Todd Linkner
// v1.1 - added support for XXHDPI, XXXHDPI and added PNG to the file selector
//
// This script is for Photoshop CS6. It outputs Android icons of the
// following sizes from a source PSD at least 512px x 512px
//
// store:
@teebu
teebu / removeblankpages.sh
Created Aug 2, 2018
Remove blank pages from PDF
View removeblankpages.sh
#!/bin/bash
IN="$1"
OUT="$2"
PAGES=$(pdfinfo $IN | grep ^Pages: | tr -dc '0-9')
non_blank() {
for i in $(seq 1 $PAGES)
do
# more color spectrum
#convert -density 46 "$IN[$((i-1))]" -define histogram:unique-colors=true -format %c histogram:info:- | wc -l
if [ $(convert -density 16 "$IN[$((i-1))]" +dither -colors 8 -depth 4 -define histogram:unique-colors=true -format %c histogram:info:- | wc -l) -ne 1 ]
@teebu
teebu / imagemagick.bash
Last active Aug 2, 2018 — forked from bensie/imagemagick.bash
ImageMagick Static Binaries for AWS Lambda ImageMagick-6.9.10-8 for AWS Lambda
View imagemagick.bash
#!/usr/bin/env bash
# Must be run on an Amazon Linux AMI that matches AWS Lambda's runtime
# As of Nov 23, 2015, this is Amazon Linux AMI 2014.09.2 x86_64 (ami-0c682c64)
#
# Lambda includes ImageMagick 6.7.8-9 preinstalled, so you need to prepend PATH
# with the folder containing these binaries in your Lambda function to ensure
# these newer binaries are used.
#
# imagemagick binary will be in /var/task/imagemagick/bin/convert
@teebu
teebu / delay.js
Created Jul 6, 2018 — forked from daliborgogic/delay.js
Node.js Async/Await delay
View delay.js
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@teebu
teebu / remove_pdf_password.sh
Created Jan 12, 2018 — forked from pstaender/remove_pdf_password.sh
Remove password from protected PDF file with GhostScript
View remove_pdf_password.sh
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
View install_python_36_amazon_linux.sh
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda
# and can be used for developing/testing Python 3.6 Lambda functions
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python
# This is required because Amazon Linux does not come with Python 3.6 pre-installed
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime
# The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm)
# running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3
# and was developed with the help of AWS Support
@teebu
teebu / gist:4730a3faacbeac3235e2a5f76274d763
Created Nov 17, 2017
Setting up Sentry in travis.yml
View gist:4730a3faacbeac3235e2a5f76274d763
Set env variables in travis.yml:
```
export SENTRY_AUTH_TOKEN=...
export SENTRY_ORG=organization-slug
```
update_sentry.sh:
```
@teebu
teebu / app.js
Created Nov 2, 2017
sample raven event logging
View app.js
const async = require('async');
const download = require('download');
const fs = require('fs-extra');
const RavenLambdaWrapper = require('serverless-sentry-lib');
const Raven = require('raven')
// Wrap handler for automated error and exception logging
const ravenConfig = {
filterLocal: false,
captureErrors: true, // Don't log error responses from the Lambda ...
@teebu
teebu / logstash.conf
Last active Feb 6, 2019 — forked from mkleucker/logstash.conf
Grok filter for Cloudfront Logs to be used with Logstash & ElasticSearch
View logstash.conf
filter {
grok {
match => [
"message", "%{YEAR:year}-%{MONTHNUM:month}-%{MONTHDAY:day}[\t]%{TIME:time}[\t](?<x_edge_location>\b[\w\-]+\b)[\t](?:%{NUMBER:sc_bytes}|-)[\t]%{IPORHOST:clientip}[\t]%{WORD:cs_method}[\t]%{HOSTNAME:cs_host}[\t]%{NOTSPACE:cs_uri_stem}[\t]%{NUMBER:sc_status}[\t]%{GREEDYDATA:referrer}[\t]%{GREEDYDATA:agent}[\t]%{GREEDYDATA:cs_uri_query}[\t]%{GREEDYDATA:cookies}[\t]%{WORD:x_edge_result_type}[\t]%{NOTSPACE:x_edge_request_id}[\t]%{HOSTNAME:x_host_header}[\t]%{GREEDYDATA:cs_protocol}[\t]%{INT:cs_bytes}[\t]%{GREEDYDATA:time_taken}[\t]%{GREEDYDATA:x_forwarded_for}[\t]%{GREEDYDATA:ssl_protocol}[\t]%{GREEDYDATA:ssl_cipher}[\t]%{GREEDYDATA:x_edge_response_result_type}[\t]%{GREEDYDATA:cs_protocol_version}"
]
}
geoip {
source => "c_ip"
}
mutate {
You can’t perform that action at this time.