Skip to content

Instantly share code, notes, and snippets.

View sgasser's full-sized avatar

Stefan Gasser sgasser

View GitHub Profile
@sgasser
sgasser / aws_s3_all_buckets.sh
Last active March 12, 2019 11:02
AWS S3 File Size and Count of ALL buckets
#!/bin/bash
#
# Download and run:
# bash aws_s3_all_buckets.sh > aws_s3_all_buckets.csv
#
# Or call directly:
# bash <(curl -s https://gist.githubusercontent.com/sgasser/7e2b472a8fbb01e17001284185a617c7/raw) > aws_s3_all_buckets.csv
# get all buckets
buckets=$(aws s3api list-buckets --query "Buckets[].Name" | jq -r '.[]')
@sgasser
sgasser / session.php
Created February 21, 2019 17:01
Session Heroku Config
<?php
return [
/*...*/
'driver' => env('SESSION_DRIVER', 'redis'),
/*...*/
];
@sgasser
sgasser / SchedulerDaemon.php
Created February 18, 2019 10:48
SchedulerDaemon.php for Heroku Laravel Scheduler
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
/**
* Runs the scheduler every 60 seconds as expected to be done by cron.
*/
class SchedulerDaemon extends Command
@sgasser
sgasser / Procfile
Created February 18, 2019 10:42
Procfile for Heroku Laravel Scheduler
scheduler: php -d memory_limit=512M artisan schedule:daemon
@sgasser
sgasser / Procfile
Created February 17, 2019 22:03
Laravel release Procfile
release: php artisan migrate --force && php artisan cache:clear
@sgasser
sgasser / database.php
Last active March 25, 2019 19:17
database.php for Heroku
<?php
$dbHost = env('DB_HOST', '127.0.0.1');
$dbPort = env('DB_PORT', '5432');
$dbName = env('DB_DATABASE', 'forge');
$dbUser = env('DB_USERNAME', 'forge');
$dbPassword = env('DB_PASSWORD', '');
if (env('DATABASE_URL')) {
$databaseUrl = parse_url(env('DATABASE_URL'));
@sgasser
sgasser / Update remote repo
Last active July 20, 2018 06:45 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
git remote rename origin bitbucket
git remote add origin https://github.com/mandiwise/awesome-new-repo.git
git push origin master
// check not merged branches and push
git push origin --tag
#!/bin/bash
git branch -D gh-pages
git push origin --delete gh-pages
git checkout -b gh-pages
ember build --environment production
find . ! -name .git ! -name publishToGithubPages.sh ! -name dist -maxdepth 1 -exec rm -rf {} \;
mv dist/* .
rm -rf dist
git add --all .
git reset HEAD publishToGithubPages.sh