Skip to content

Instantly share code, notes, and snippets.

View Yavari's full-sized avatar

Payam Yavari Yavari

View GitHub Profile
version: "2.1"
networks:
internal_network:
services:
db:
restart: always
networks:
- internal_network
build: ./MongoDB
environment:
@Yavari
Yavari / guac.sh
Last active August 29, 2018 05:49 — forked from chrisruffalo/guac.sh
A script that will allow a docker host to start a guacd system of hosts and initialize the postgres database all in one go
#!/bin/bash
POSTGRES_USER=guac
POSTGRES_PASS=guac
POSTGRES_DB=guac
# create storage for postgres container
NEW_VOLUME=false
if [[ "" == $(docker volume ls | grep guac-postgres-volume) ]]; then
printf "Creating a new volume for guac-postgres...\n"
@Yavari
Yavari / remove-orphaned-raw-images.py
Created July 5, 2018 17:33 — forked from kiekerjan/remove-orphaned-raw-images.py
Do you own a DSLR? If so, do you transfer your images to your computer, then look at the JPEGs and delete the crappy ones? If you do, your RAW images may be leftover. This Python script helps you cleaning up your image folders after deleting unwanted JPEGs. See http://blog.philippklaus.de/2012/12/cleaning-leftover-raw-images-after-selecting-imag…
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written on 2012-12-12 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
Check <https://gist.github.com/4271012> for newer versions.
Slightly adapted to include other RAW formats and to make the tool work in reverse (i.e. remove JPEGs for which no raw can be found.) The script also cleans Sidecar (.xmp) files if present.
Moved to python3 (see
"""
@Yavari
Yavari / godaddydnsupdater.sh
Created March 3, 2018 12:24
Update A record to my dynamic server ip
#!/bin/bash
# This script is used to check and update your GoDaddy DNS server to the IP address of your current internet connection.
# Special thanks to mfox for his ps script
# https://github.com/markafox/GoDaddy_Powershell_DDNS
# and https://se.godaddy.com/community/Managing-Domains/Dynamic-DNS-Updates/td-p/7862
# where i found this script
#
# First go to GoDaddy developer site to create a developer account and get your key and secret
#
Split-Path -parent $dte.Solution.FileName | cd
New-Item -ItemType Directory -Force -Path ".\licenses"
@( Get-Project -All |
? { $_.ProjectName } |
% { Get-Package -ProjectName $_.ProjectName } ) |
Sort -Unique |
% { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, (Join-Path (pwd) 'licenses\') + $pkg.Id + ".html") } Catch [system.exception] { Write-Host "Could not download license for $pkg" } }
@Yavari
Yavari / README.markdown
Created February 23, 2012 09:00 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string