Skip to content

Instantly share code, notes, and snippets.

View ashgkwd's full-sized avatar
💎
Open to work

Ash Gaikwad ashgkwd

💎
Open to work
View GitHub Profile
@kofronpi
kofronpi / db.rake
Last active August 28, 2017 09:32 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
namespace :db do
DUMP_FMT = 'p' # 'c', 'p', 't', 'd'
desc 'Dumps the database to backups'
task sql_dump: :environment do
dump_sfx = suffix_for_format(DUMP_FMT)
backup_dir = backup_directory(true)
cmd = nil
with_config do |app, host, db, user|
file_name = Time.now.strftime("%Y%m%d%H%M%S") + "_" + db + '.' + dump_sfx
@ashgkwd
ashgkwd / agbashrc.sh
Last active November 27, 2018 12:17
A bash rc add-on which contains simple functions and aliases which are generally used by the author
# @author: Ashish Gawikwad <ash.gkwd@gmail.com>
# @license: MIT License
# @script: It contains all the functions and aliases which
# are frequently used by author.
#
sleepToRAM () {
dbus-send --system --print-reply \
--dest="org.freedesktop.UPower" \
/org/freedesktop/UPower \