Skip to content

Instantly share code, notes, and snippets.

@satchinjoshi
satchinjoshi / CountryCodes.json
Created October 14, 2022 22:48 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"

Keybase proof

I hereby claim:

  • I am satchinjoshi on github.
  • I am satchin (https://keybase.io/satchin) on keybase.
  • I have a public key ASDiJ0Y9hgarorYFkG8bYsRNWwmVRFKPaD1167lBvjrxDwo

To claim this, I am signing this object:

@satchinjoshi
satchinjoshi / deploy.rb
Created October 5, 2017 11:07
mina multi stage deploy
require 'time'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
set :application_name, 'ug'
set :repository, '[email protected]:xxx/xxx.git'
set :branch, ENV['BRANCH'] || 'master'
set :build_assets, ENV['ASSETS'] || 'no'
test_and_deploy_to_staging:
script:
- rm .env.test
- cp .env.gitlab-ci .env.test
- cp .env.test .env
- bundle install --path vendor --quiet
- bundle exec rails db:test:prepare --quiet
- bundle exec rails db:migrate --quiet
- bundle exec rails test
- apk add --update openssh
echo "----------------- started -------------------"
sudo apt-get update
echo "----------------- installing dependencies -------------"
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs
echo "----------------- install ruby ---------------------"
cd
wget http://ftp.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz
tar -xzvf ruby-2.4.1.tar.gz
@satchinjoshi
satchinjoshi / npm-wercker.yml
Created September 11, 2017 06:51
npm-wercker.yml
build:
box: satchinjoshi/node-alpine:8-alpine
steps:
- script:
name: set yarn cache
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install packages
code: yarn
- script:
#!/bin/bash
sudo apt -y update
# make swap of 1GB
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Devops commands
namespace :ops do
desc 'reload the nginx server'
task :reload_server do
on roles(:app) do
execute :sudo, :service, 'nginx reload'
end
end
desc 'reload php-fpm'
server {
listen 80;
listen [::]:80;
server_name xyz.com;
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /var/www/letsencrypt;
}
location / {
return 301 https://$server_name$request_uri;