Skip to content

Instantly share code, notes, and snippets.

View rupakraj's full-sized avatar

Rupak Raj Ghimire rupakraj

View GitHub Profile
@rupakraj
rupakraj / git-deployment.md
Created May 30, 2020 08:00 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@rupakraj
rupakraj / rpi-audio.md
Created January 6, 2017 05:02
rpi sound

#enabling sound on rpi 3

  1. Install software $ sudo pacman -S alsa-firmware alsa-lib alsa-plugins alsa-utils

  2. Turn sound device on $ sudo modprobe snd-bcm2835

  3. create /etc/modules-load.d/snd-bcm2835.conf

@rupakraj
rupakraj / Git on Context Menu
Created December 5, 2016 04:01
Bring git on context menu of working directory
It assumes your bash installation is from Git Bash for Windows from git's official downloads.
cmd /c (start /b "%cd%" "C:\Program Files\Git\git-bash.exe") && exit
I ended up using this after I lost my context-menu items for Git Bash as my command to run from the registry settings. In case you're curious about that, I did this:
Create a new key called Bash in the shell key at HKEY_CLASSES_ROOT\Directory\Background\shell
Add a string value to Icon (not a new key!) that is the full path to your git-bash.exe, including the git-bash.exe part. You might need to wrap this in quotes.
Edit the default value of Bash to the text you want to use in the context menu enter image description here
Add a sub-key to Bash called command
@rupakraj
rupakraj / Configuring vps for first time
Last active May 21, 2017 10:42
Configuring vps for first time (reference ubuntu)
# OS: Ubuntu
## Basic Configuration
-- login using ssh
# ssh root@IP
-- Update latest updates/security patches
-- set timezone
# timedatectl set-ntp true
# dpkg-reconfigure tzdata
-- Add new user -
@rupakraj
rupakraj / Making USB stick bootable using winusb
Created October 26, 2016 12:09
Making USB stick bootable using winusb
If we need to make usb stick bootable of windows ISO follow the steps
```
$ sudo apt-get install winusb
```
run winusb comand with appropiate parameters
```
$ sudo winusb --format <ISO file> <desk>
```
Example
```
@rupakraj
rupakraj / last-lastb
Created February 26, 2016 09:19
Handy Shell Commands for checking SSH Access using last, lastb, sed
# lastb : Unsuccessful attempts
# last : Successful attempts
sudo lastb | sed 's/ \+/ /g'| cut -d' ' -f3 | sort | uniq -c | sort -n
sudo last | sed 's/ \+/ /g'| cut -d' ' -f3 | sort | uniq -c | sort -n
@rupakraj
rupakraj / png-fix-android
Created February 25, 2016 08:54
PNG fixes: iCCP: Not recognizing known sRGB profile that has been edited
SRC: http://pmt.sourceforge.net/pngcrush/
Issue fixes for : #AAPT: *.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Use pngcrush to remove the incorrect sRGB profile from the png file:
pngcrush -ow -rem allb -reduce file.png
-ow will overwrite the input file
-rem allb will remove all ancillary chunks except tRNS and gAMA
-reduce does lossless color-type or bit-depth reduction
@rupakraj
rupakraj / timer
Last active February 25, 2016 05:18
Android - contineous call to function
private void Timer(){
final Handler ha=new Handler();
ha.postDelayed(new Runnable() {
@Override
public void run() {
Debug.Log("Calling data");
// call your function
ha.postDelayed(this, 20*1000);
}
@rupakraj
rupakraj / DJangoTemplate
Created February 11, 2016 16:41
Handy tags and blocks for Django. Useful for the programmer
# DJango Template Tags Cheat Sheet
## Inheritance and Inclusion
{% extends "base.html "%}
{% block content %} ... {% endblock %} or {% block content %} ... {% endblock content %}
{% include "foo/bar.html" %}
{% ssi /home/html/ljworld.com/includes/right_generic.html %}
## Filters and Tags
@rupakraj
rupakraj / RDM630.c
Created February 11, 2016 16:38
Used to read and verify data from RDM630 RFID Reader (Serial).
// Found somewhere in website, and updated.
#include <SoftwareSerial.h>
SoftwareSerial RFID(2, 3); // RX and TX
int data1 = 0;
int ok = -1;
int yes = 13;
int no = 12;