Skip to content

Instantly share code, notes, and snippets.

View yogendra's full-sized avatar

Yogendra Rampuria - Yogi yogendra

View GitHub Profile
@yogendra
yogendra / matching.js
Created January 30, 2018 13:36
Mongo Find (Un)matching documents in 2 collections
use db1
db.createCollection("scrapped");
db.scrapped.insert(
[
{ sku: "12345" },
{ sku: "23456" },
{ sku: "34567" },
{ sku: "45678" },
@yogendra
yogendra / dc_trace_cmd.sh
Last active October 14, 2017 04:28
Docker Helper
#!/bin/sh
parent=`docker inspect -f '{{ .Parent }}' $1` 2>/dev/null
level=${2:-1}
echo ${level}: `docker inspect -f '{{ .ContainerConfig.Cmd }}' $1 2>/dev/null`
level=$((level+1))
if [ "${parent}" != "" ]; then
echo ${level}: $parent
$0 $parent $level
fi
@yogendra
yogendra / Readme.md
Last active October 14, 2017 14:29
Puppeteer Notes
@yogendra
yogendra / highlight-selected-text.js
Last active September 14, 2017 09:16
Simple Scripts to Modify HTML Content
(function(module){
if(window[module.name]){
return;
}
module.init();
window[module.name] = module.run;
})({
name: "highlightSelection",
init : function(){
var css = document.createElement('link');
@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org"
@echo =============================================
@echo ... and then turn on the time service back on
net start w32time
@yogendra
yogendra / brew-install-ffmpeg.sh
Created March 13, 2016 21:02
OS X Important Setup Commands
brew reinstall ffmpeg --with-rtmpdump --with-libass --with-opencore-am --with-openjpeg --with-openssl --with-libssh --with-schroedinger --with-ffplay --with-tools --with-fdk-aa --with-libvidstab --with-x265 --with-libsoxr --with-webp --with-zeromq --with-snappy --with-dcadec --with-rubberband --with-zimg --with-openh264
@yogendra
yogendra / README.md
Last active January 29, 2019 17:13
Boilerplate linux scripts. Mostly provisioners for Vagrant

Setup linux OS Scripts

Most of these scripts are run as sudo.

Example:

curl -L "https://gist.github.com/yogendra/7d23440d2d139cf8d426/raw/setup-ubuntu-docker.sh" | sudo bash

Or

wget -qO- "https://gist.github.com/yogendra/7d23440d2d139cf8d426/raw/setup-ubuntu-docker.sh" | sudo bash
@yogendra
yogendra / docker-cleanup.sh
Last active January 28, 2016 16:46
Vagrant scripts
$(docker ps -a -q -f status=exited) | xargs -r docker rm -v
docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
@yogendra
yogendra / fix-sudo
Created April 14, 2015 15:32
Vagrant Ubuntu Box Init
#Add vagrant as sudo user with no password required
# vagrant ALL=(ALL) NOPASSWD: ALL >> /etc/
sudo visudo
@yogendra
yogendra / build.xml
Last active December 2, 2024 14:08 — forked from anonymous/build.xml
Simple Ant Build Script for Eclipse Dynamic Web Project #java #ant #snippet
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="package" name="PROJECT_NAME">
<!--
This script assumes:
1) CATALINA_HOME environment variable points to tomcat's directory
2) Following Folder Structure
./ (project root)
|- src/ (project.src.dir - source folder)
|- build/
| |- classes/ (project.classes.dir)