Skip to content

Instantly share code, notes, and snippets.

@1v
1v / postgresql-backup-and-restore.md
Created October 6, 2022 22:24 — forked from mcandre/postgresql-backup-and-restore.md
PostgreSQL Backup and Restore

POSTGRESQL BACKUP AND RESTORE

$ pg_dumpall --clean -U <user> -f backup.sql
$ psql -U <user> -f backup.sql

Warnings

  • A PostgreSQL user with administrative privileges is required.
@1v
1v / squid_proxy_tutorial.md
Created November 8, 2021 01:09 — forked from jackblk/squid_proxy_tutorial.md
Tutorial on how to setup a squid proxy with authentication.

Note

This tutorial is for Ubuntu & Squid3. Use AWS, Google cloud, Digital Ocean or any services with Ubuntu to follow this tutorial.

Install squid & update

sudo apt-get update
sudo apt-get install squid3
sudo apt-get install apache2-utils
@1v
1v / resque.rake
Last active April 4, 2016 05:07 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
require 'resque/tasks'
require 'resque/scheduler/tasks'
def get_pgid(file)
pgid = true
if File.file?(file)
fpid = File.read(file).to_i
pgid = `ps -o pgid --no-headers --pid #{fpid}`.strip!
if pgid
puts "Process group ID found: #{pgid}"
@1v
1v / downgrade.sh
Last active January 31, 2018 13:09 — forked from reagent/downgrade.sh
Apache 2.2.22 + PHP 5.3.10 on Ubuntu 14.04
cat <<EOF >> /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
apt-get update
apt-get remove \
apache2 \
@1v
1v / gist:1633180ce64af07e23d0
Last active August 29, 2015 14:04 — forked from anonymous/gist:107dc04a9d9199db1117
How to turn off ads in µTorrent

Options>preferences>Advanced...

Turn all these settings to false:

left_rail_offer
gui.show_plus_upsell
sponsored_torrent_offer_enabled
bt.enable_pulse
gui.show_notorrents_node
offers.content_offer_autoexec
@1v
1v / gist:a38f247c41ca60f6e48a
Last active August 29, 2015 14:03 — forked from ancap/gist:7616833
Ruby on Rails "Hellow World" app

Ruby on Rails "Hellow World" app

Run:

rails g controller StaticPages index

In config/routes.rb add:

root "static_pages#index"

###Show variable contents from controller in view###

@1v
1v / gist:10272479
Last active June 6, 2017 01:27 — forked from ancap/gist:7385992
Ruby on Rails installation on Ubuntu 12.04 LTS + Nginx + Puma

Ruby on Rails installation on Ubuntu 12.04 LTS + Nginx + Puma

Adding new user

Create new user:

sudo useradd -G sudo -m -s /bin/bash luna

blog.lunarlogic.io

Change password: