Skip to content

Instantly share code, notes, and snippets.

Avatar

Rupak Raj Ghimire rupakraj

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

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.

View rpi-audio.md

#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 Dec 5, 2016
Bring git on context menu of working directory
View Git on Context Menu
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
Configuring vps for first time (reference ubuntu)
View Configuring vps for first time
# 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 Oct 26, 2016
Making USB stick bootable using winusb
View 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 Feb 26, 2016
Handy Shell Commands for checking SSH Access using last, lastb, sed
View last-lastb
# 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 Feb 25, 2016
PNG fixes: iCCP: Not recognizing known sRGB profile that has been edited
View png-fix-android
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 Feb 25, 2016
Android - contineous call to function
View timer
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 Feb 11, 2016
Handy tags and blocks for Django. Useful for the programmer
View DJangoTemplate
# 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 Feb 11, 2016
Used to read and verify data from RDM630 RFID Reader (Serial).
View RDM630.c
// 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;