Skip to content

Instantly share code, notes, and snippets.

@simkimsia
simkimsia / docker commands.sh
Last active August 29, 2015 14:20
useful bash commands for docker
#remove all containers
docker rm $(docker kill $(docker ps -a -q))
docker rmi image_id #where image_id is the id of the specific image you want to remove
docker ps -a # Lists all containers
docker build -t django18-python27-ubuntu1404 . ## build docker reponame dockerfilepath
docker run -ti django18-python27-ubuntu1404 sh ## run the docker and go in
pm WARN package.json starter-kit@0.0.1 No repository field.
npm WARN deprecated css-sprite@0.9.9: css-sprite is now called sprity
npm WARN optional dep failed, continuing fsevents@0.3.6
> spawn-sync@1.0.11 postinstall /var/virtual/WebApps/kstest/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall
> spawn-sync@1.0.11 postinstall /var/virtual/WebApps/kstest/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/bin-check/node_modules/spawn-sync
> node postinstall
@simkimsia
simkimsia / readme.md
Last active August 29, 2015 14:23
How to develop and deploy django 1.8

develop and deploy django

First we consider the development environment.

It will be done using virtualbox + vagrant + ubuntu14.04

  1. Inside develop environment nginx (install using ubuntu repositories):
########################################
@simkimsia
simkimsia / README.md
Last active August 29, 2015 14:26
pg_hba.conf for 9.3 so that I can access via TCP/IP connection over remote connection

how to use postgres

By default, should never change the postgres user password

See http://serverfault.com/a/325596/61030

To access the database as postgres,

  1. go into the server
  2. use sudo -u postgres psql postgres
@simkimsia
simkimsia / deploy.rb
Created October 30, 2010 12:41
deploy.rb for copying files after deploy for staging
# setting for staging environment
task :staging do
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/www/staging"
after("deploy:default", :copy_config_files)
end
#Deployment tasks
#!/bin/sh
sed -i 's/Configure::write('debug', 2);/Configure::write('debug', 0);/g' /opt/lampp/htdocs/wp/app/config/bootstrap.local.php
# idea is bootstrap.local.php is the file
# original string is Configure::write('debug', 2);
# replace it with Configure::write('debug', 0);
@simkimsia
simkimsia / RunAppTests.sh
Created March 23, 2012 04:30
how to do a bash script for myapp app folder
#!/bin/bash
cp myapp/Config/core.php myapp/Config/core.php.backup
echo "Configure::write('Acl.database', 'test');" >> myapp/Config/core.php
lib/Cake/Console/cake testsuite -app myapp app
mv myapp/Config/core.php.backup myapp/Config/core.php
@simkimsia
simkimsia / ubuntu-11xx-fabric-base.sh
Created May 8, 2012 00:32
install Ubuntu 11.x Python, Pip, Fabric
#!/bin/bash
###
#
# Copyright (c) 2012 https://github.com/simkimsia
#
# Ubuntu 11.04, 11.10 based installation script for Python, Pip and Fabric
# Run this by executing the following from a fresh install of Ubuntu 11.04, 11.10 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/2631668)"
@simkimsia
simkimsia / ubuntu-11.xx-jenkins-install.sh
Created May 13, 2012 10:40
Install Jenkins and related dependencies
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http://cakedc.com)
#
# Ubuntu 11.xx server installation script for Jenkins
# Run this by executing the following from a fresh install of Ubuntu 11.xx server:
#
@simkimsia
simkimsia / index.php
Created June 5, 2012 15:36
for learning GET params
<?php
//Define an array of character information
$characters = array(
'yakko' => array (
'id' => 'yakkowarner',
'url' => 'characterview.php?id=yakkowarner',
'name' => 'Yakko Warner'
),