Skip to content

Instantly share code, notes, and snippets.

View satyadeepk's full-sized avatar

Satyadeep satyadeepk

View GitHub Profile
@satyadeepk
satyadeepk / autoexec.py
Last active September 3, 2020 17:14
Kodi script to auto resume last playing video in last 1 hour on boot
## Place this file in /home/osmc/.kodi/userdata
## Original at https://www.reddit.com/r/kodi/comments/6x7898/how_to_automatically_start_playing_an_inprogress/
import time
time.sleep(10)
import os
import sqlite3
import sys
import xbmc
@satyadeepk
satyadeepk / enable-cache.conf
Last active November 13, 2019 08:10
Nginx Proxy Caching
#Source: https://stackoverflow.com/a/46266032/559680
# Put these above server block (Don't forget to give write permissions to the cache folder):
# proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=default_cache:10m max_size=100m inactive=5m use_temp_path=off;
# proxy_cache_key "$scheme$request_method$host$request_uri";
# proxy_cache_valid 200 302 60m;
# To use this in location:
# include enable-cache.conf
@satyadeepk
satyadeepk / git-make-empty-root.sh
Last active April 24, 2019 13:42 — forked from nicktoumpelis/git-make-empty-root.sh
Create an empty initial commit for a pull request for new project
git checkout --orphan temp
git rm -rf .
git commit --allow-empty -m 'Make initial root commit'
git rebase --onto temp --root develop
git push origin --force develop:develop
git push origin temp:master
git branch -D temp
@satyadeepk
satyadeepk / downgrademysql.md
Last active January 27, 2018 17:18 — forked from Voronenko/downgrademysql.md
Downgrade mysql to mysql 5.6 on Ubuntu 16.04 xenial

Install MySQL 5.6 in Ubuntu 16.04

Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range of backwards compatibility issues with code written against older MySQL versions.

Oracle maintains a list of official APT repositories for MySQL 5.6, but those repositories do not yet support Ubuntu 16.04. However, the 15.10 repos will work for 16.04.

Uninstall existing mysql 5.7 if any

sudo apt remove mysql-client mysql-server libmysqlclient-dev mysql-common
@satyadeepk
satyadeepk / gcloud_install.sh
Last active February 18, 2022 12:21
Jenkins Google Cloud SDK install with auth script
#Ref: https://github.com/circleci/android-cloud-test-lab/blob/master/circle.yml
export DIRECTORY="/var/jenkins_home/GoogleCloudSDK/google-cloud-sdk/bin"
if [ ! -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY doesn't exist.
cd /var/jenkins_home
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip -O google-cloud-sdk.zip
unzip -o google-cloud-sdk.zip -d ./GoogleCloudSDK/
./GoogleCloudSDK/google-cloud-sdk/install.sh
@satyadeepk
satyadeepk / ParseProxyObject.java
Last active October 5, 2015 14:27 — forked from janakagamini/ParseProxyObject.java
A Parse.com Serializable ParseObject Proxy for passing around activities
import com.parse.ParseFile;
import com.parse.ParseGeoPoint;
import com.parse.ParseObject;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
public class ParseProxyObject implements Serializable {
@satyadeepk
satyadeepk / tampermonkey.js
Last active August 29, 2015 14:19
Parse.com GeoPoint to Google map in Data browser
// ==UserScript==
// @name Parse google map
// @namespace http://addodoc.com
// @version 0.1
// @description Opens a Parse GeoPoint from the Data browser into a Google map on click
// @include https://parse.com/apps/rocket*collections
// @include https://www.parse.com/apps/rocket*collections
// @copyright 2012+, You
// ==/UserScript==
@satyadeepk
satyadeepk / log-parse.sh
Last active April 27, 2016 17:01
Drain Parse.com logs to a file
#!/bin/sh
# Restartes the parse log if it crashes
# stdbuf flushes the Parse log buffer so they come in real time
until stdbuf -oL /usr/local/bin/parse log -f > info.log; do
echo "Parse log crashed with exit code $?. Respawning.." >&2
sleep 1
done
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html
try {
int i = 3 / 0;
} catch (Exception e) {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = report.processName = getApplication()
.getPackageName();
report.time = System.currentTimeMillis();
report.type = ApplicationErrorReport.TYPE_CRASH;