Skip to content

Instantly share code, notes, and snippets.

View sahilchopra's full-sized avatar

Sahil Chopra sahilchopra

View GitHub Profile
@sahilchopra
sahilchopra / Motorcycle.md
Last active February 27, 2025 18:30 — forked from ElioLopez/Grundstoff.md
Fahrschule, driving license germany, berlin

Where should a passenger on a motorcycle with sidecar sit to reduce the risk of tipping over on bends?

  • On the motorcycle
  • The position of the occupants has no significance
  • In the sidecar

You notice that the lever travel of the hydraulic front wheel brake on your motorcycle has become considerably longer. What must you do?

  • Have the front wheel brake repaired
  • Fill up the brake fluid immediately
  • Only use the rear wheel brake until the next service
@sahilchopra
sahilchopra / german-driving-license.md
Last active February 27, 2025 18:30 — forked from everton137/german-driving-license.md
Quick Ref Notes for German Driving License Test

https://gist.github.com/ElioLopez/0b725ab7d64690a6144713f8d66ed6e5

https://www.clickclickdrive.de/fragenkatalog/en/1.1.-danger-teaching/1.1.01-basic-forms-of-traffic-behavior#gsc.tab=0

hard shoulder he hard shoulder, also known as the emergency lane or breakdown lane, is the area to the side of a roadway, usually delimited by a solid white line. It's primarily intended for emergency use, such as stopping in case of a breakdown, vehicle emergencies, or for emergency services to use.

Roadway The roadway refers to the main driving surface of a road or highway, typically delimited by lane markings. It's where vehicles travel, and it's designed and maintained for regular traffic flow.

Lay-by: A lay-by is a designated area along a road where vehicles can pull off to the side to stop temporarily. It's often used for rest breaks, to make phone calls, or to take in scenic views.

@sahilchopra
sahilchopra / Sidekiq bashscript.sh
Last active January 3, 2018 09:45
Sidekiq bashscript
#!/bin/bash
echo "starting check sidekiq"
process=`cat /home/ubuntu/staging/wms/shared/pids/sidekiq.pid`
processConfirmation=`ps aux | awk '{print $2 }' | grep $process`
if [ -z $processConfirmation ]
then
echo "oops! not running... restarting sidekiq"
@sahilchopra
sahilchopra / nginx.conf
Last active September 4, 2018 08:15 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@sahilchopra
sahilchopra / Configuring nginx.conf
Last active July 27, 2016 06:16 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
The nginx install process on ubuntu creates a folder at /etc/nginx. In this folder you’ll find a few configuration files, along with a sites-available and a sites-enabled folder. The sites-available folder is where you’ll configure your application-specific nginx setup, and /etc/nginx/nginx.conf is most likely where you’ll configure global nginx settings. The following is a sensibly configured nginx.conf.
--------------------------------------------------------------------------------------------------------------------
# Run nginx as www-data.
user www-data;
# One worker process per CPU core is a good guideline.
worker_processes 1;
# The pidfile location.
@sahilchopra
sahilchopra / deploy_rails_app_on_ubuntu.md
Created May 6, 2016 07:11 — forked from he9lin/deploy_rails_app_on_ubuntu.md
Setup Rails application production environment on Ubuntu

Setup Rails application production environment on Ubuntu

Add deploy user

ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL

Install necessary libraries

@sahilchopra
sahilchopra / install_ffmpeg_ubuntu.sh
Created May 5, 2016 07:55 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@sahilchopra
sahilchopra / install-php-redis-ubuntu.sh
Created April 9, 2016 05:33 — forked from iJackUA/install-php-redis-ubuntu.sh
Install php_redis extension from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "php_redis version to be installed (change if needed) : " -i "2.2.4" VERSION
echo 'Installing php_redis v.'$VERSION' ... '
@sahilchopra
sahilchopra / install-redis-ubuntu.sh
Created April 9, 2016 05:32 — forked from iJackUA/install-redis-ubuntu.sh
Install Redis from source (Ubuntu)
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "ERROR : Run script as Root (sudo !!) please"
exit 1
fi
read -e -p "Redis version to be installed (change if needed) : " -i "2.8.2" VERSION
echo 'Installing redis v.'$VERSION' ... '