Skip to content

Instantly share code, notes, and snippets.

View sgrodzicki's full-sized avatar

Sebastian Grodzicki sgrodzicki

View GitHub Profile
@jakzal
jakzal / deploy.rb
Created October 25, 2011 11:41
parameters.yml configuration during capifony deployment for Symfony2
set :shared_files, [app_path + "/config/parameters.yml"]
namespace :symfony do
namespace :configure do
def shared_parameters_path
"#{shared_path}/#{app_path}/config/parameters.yml"
end
def app_parameters_path
"#{latest_release}/#{app_path}/config/parameters.yml"
@peterjmit
peterjmit / deploy.rb
Created April 10, 2012 13:45
Create a parameters.ini file interactively when deploying with capifony
# This custom task for deploying a Symfony 2 application is set to run after deploy:setup
# is executed. It interactively ask a user for database details to create a parameters.ini
# thus avoiding having to manually on to the server and create it
#
# Helper function from http://stackoverflow.com/a/1662001/1041885
#
# Interactive parameter.ini generation adapted from http://adurieux.blogspot.co.uk/2011/10/using-capistrano.html
# ...
# ... Your deployment settings/tasks
@lgrz
lgrz / deploy.rb
Created August 7, 2012 00:43
Collection of Capifony tasks
after "deploy:restart", "deploy:cleanup"
after "deploy:setup", "symfony:setup:parameters_init"
# Clear the cache before the cache:warmup task is run. The cache directory is
# shared, that way setting ACL's only happens once and we avoid the use of
# sudo
before 'deploy:finalize_update', 'symfony:cache:remove'
namespace :symfony do
namespace :cache do
@microlinux
microlinux / zping.sh
Last active August 28, 2023 13:28
Bash script for storing ping data in RRDs and graphing that data
#!/bin/bash
#
# INSTALL
# -------
# 1.) Create directory structure
# <base_dir>
# <base_dir>\bin
# <base_dir>\etc
# <base_dir>\log
# <base_dir>\rrd
@wataruoguchi
wataruoguchi / How to make your website to maintenance mode.md
Last active January 7, 2024 14:28
How to make your website to maintenance mode - Apache

Apache

How to make your website to maintenance mode

  1. Put maintenance.html into your root directory

  2. Open .htaccess file

  3. Insert this block in the first line of the file

     ErrorDocument 503 /maintenance.html
     <IfModule mod_rewrite.c>
    

RewriteEngine On

@iamweird
iamweird / genshadow.php
Created March 3, 2017 11:10
Simple PHP script to generate /etc/shadow style $6$ (SHA-512) password hashes
#!/usr/bin/env php
<?php
if (count($argv) < 3) {
echo <<<USAGE
Usage: genshadow.php salt password
USAGE;
exit(0);
}
@HTMLGuyLLC
HTMLGuyLLC / shared-env-vars.md
Last active January 4, 2024 17:38
How to share environment variables between Ubuntu Users and Apache

Sharing Environment Variables Between your Ubuntu user, and Apache.

Many blogs suggest putting your variables in /etc/environment and including that file in /etc/apache2/envvars, but that solution did not work for me. After hours of searching and testing, this is what I came up with. I figured others may find it useful.

Environment: Ubuntu 16.04, Apache 2.4

Step 1

Append the following to your site's .gitignore file so that you don't accidentally commit your environment variables.

@pothi
pothi / do-debian8-locale-issues.md
Created May 6, 2021 17:04 — forked from 5car1z/do-debian8-locale-issues.md
Debian Locale Issues Fix

Debian 8 DO Locale Issues Fix

Problem

"Locale problems" in both the 32-bit & 64-bit versions of Debian 8 droplets

Create a new Debian 8 droplet and login as root:

@andrewesweet
andrewesweet / reboot-MA2500D.sh
Created July 28, 2021 14:34
Reboot GoCoax MA2500D (firmware 2.0.6) from command line
#!/bin/sh
# Substitute your IPs as required
for var in 200 201 202 203
do
curl -X POST -u admin:gocoax --max-time 10 http://192.168.1.$var/ms/1/0xb00
done
@n-studio
n-studio / DEPLOY_WITH_KAMAL_ON_DEDICATED_SERVER.md
Last active June 12, 2024 14:10
Deploy a web app on a dedicated server with Kamal

Warning

This gist is still a draft. At the moment it is not functional: see basecamp/kamal#257

Motivation

Kamal was designed with 1 service = 1 droplet/VPS in mind.
But I'm cheap and I want to be able to deploy multiple demo/poc apps apps on my $20/month dedicated server.
What the hell, I'll even host my private container registry on it.