Skip to content

Instantly share code, notes, and snippets.

Anurag Regmi anuragregmi

Block or report user

Report or block anuragregmi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anuragregmi /
Created Apr 4, 2019
creating qemu images and running virtual machine

Create image

  • 20G is size of your image, or hard disk for virtual machine
  • virtual.img is the image file
qemu-img create -f qcow2 virtual.img 20G

Booting img for first time for installation

  • 2G is RAM for virtual machine
anuragregmi /
Last active Nov 30, 2018 — forked from adhikariravi/
Python/ Django Coding Guideliness

PEP-8 Guide

Indentation and Spacing

  • Use four spaces for indentation.

  • Hanging indents should add a level.

    def long_function_name(
        var_one, var_two, var_three,

Keybase proof

I hereby claim:

  • I am anuragregmi on github.
  • I am anurag_ ( on keybase.
  • I have a public key whose fingerprint is 15C2 3DC3 C140 FA27 30FF A802 04C6 82FF 8B83 0D6E

To claim this, I am signing this object:

anuragregmi / tab_space.c
Last active Mar 26, 2018
C program to replace tabs in a file with spaces
View tab_space.c
#define SUCCESS 0
#define FAILURE 1
int fetch_args(const int argc, char **argv, char *filepath, int *tabstop){
// process arguments
anuragregmi / tmux.conf
Last active Jan 10, 2019
My config file for tmux
View tmux.conf
set -g prefix C-a
unbind C-b
bind C-a send-prefix # Pass on ctrl-a for other apps
unbind %
unbind '"'
bind \ split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
anuragregmi / graphics_sfml.cpp
Created Aug 5, 2017
Template to plot pixels in cpp using SFML
View graphics_sfml.cpp
#include <SFML/Graphics.hpp>
using namespace sf;
int WIDTH = 800;
int HEIGHT = 600;
int main()
// Create the main window
RenderWindow app(VideoMode(WIDTH, HEIGHT), "SFML window");
anuragregmi / expiredToken.php
Last active Jun 28, 2017
Deletes expired tokens from database
View expiredToken.php
$i = 0;
$link = mysqli_connect("","root","password","db_name") or die("Could not connect");
$result = mysqli_query($link,"SELECT * FROM token_all");
while($row = mysqli_fetch_array($result)){
$token = $row['token'];
$userData = json_decode(file_get_contents(''.$token.'&fields=name,id'),true);
$loggedOuts[$i] = $token; // saving expired tokens

Keybase proof

I hereby claim:

  • I am anurag1234565 on github.
  • I am anurag_regmi ( on keybase.
  • I have a public key whose fingerprint is B686 AB38 9E19 8C6D 4E86 A0AA F943 029F 2CC2 870E

To claim this, I am signing this object:

anuragregmi /
Last active Apr 26, 2017
Text file viewer -java
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
anuragregmi / battery
Created Sep 30, 2016
Bash script to display battery status and percentage
View battery
upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep "state"
upower -i /org/freedesktop/UPower/devices/DisplayDevice | grep "percentage"
You can’t perform that action at this time.