Skip to content

Instantly share code, notes, and snippets.

View cvam0000's full-sized avatar
💭
editing dot files since 1998

cvam0000 cvam0000

💭
editing dot files since 1998
View GitHub Profile
@cvam0000
cvam0000 / git-feature-workflow.md
Created July 12, 2018 09:07 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@cvam0000
cvam0000 / install_printer
Created July 12, 2018 14:35 — forked from notdodo/install_printer
Install a printer on Arch Linux with cups using command line
#!/bin/bash
################################################################
# Install a printer on Arch Linux with cups using command line #
# Used for a HP PSC 1510 with default driver #
################################################################
yaourt -S cups
sudo systemctl start org.cups.cupsd
@cvam0000
cvam0000 / gist:1d65d6158cf67559a2b9f73e1f209cfb
Created September 6, 2018 05:06 — forked from chappyhome/gist:7117899
Move django from SQLite to MySQL
When you start develop new site, you may run from little one with tiny database.
For django best start from sqlite and after some time, if you project begin grow you move to more serious database engine (MySQL, Postgre SQL etc).
Sadly, django does not have any ready tools to move from one to another database.
You may try
python ./manage.py dumpdata > data.json
and
python ./manage.py loaddata data.json
/* An Example of Loadable Kernel Module */
#include<linux/kernel.h>
#include<linux/init.h>
#include<linux/module.h>
MODULE_DESCRIPTION("cvam example kernel module ");
MODULE_AUTHOR("cvam");
MODULE_LICENSE("GPL");
@cvam0000
cvam0000 / Makefile
Last active December 17, 2019 03:39
KDIR = /lib/modules/`uname -r`/build
kbuild:
make -C $(KDIR) M=`pwd`
clean:
make -C $(KDIR) M=`pwd` clean
EXTRA_CFLAGS = -Wall -g
obj-m = example_lkm.o
if(alloc_memory() != 0 )
return -ENOMEM;
if (user_parameter_valid()!=0)
return -EINVAL;
/*
Some of the examples of the macros are
#define ENOTEMPTY 39 /* Directory not empty */
/* Some more example of the macros for the Alert msg are */
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
#define KERN_ERR "<3>" /* error conditions */
#define KERN_WARNING "<4>" /* warning conditions */
#define KERN_NOTICE "<5>" /* normal but significant condition */
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
pr_emerg(fmt, ...); /* similar to printk(KERN_EMERG pr_fmt(fmt), ...); */
pr_alert(fmt, ...); /* similar to printk(KERN_ALERT pr_fmt(fmt), ...); */
pr_crit(fmt, ...); /* similar to printk(KERN_CRIT pr_fmt(fmt), ...); */
pr_err(fmt, ...); /* similar to printk(KERN_ERR pr_fmt(fmt), ...); */
pr_warning(fmt, ...); /* similar to printk(KERN_WARNING pr_fmt(fmt), ...); */
pr_warn(fmt, ...); /* similar to cu printk(KERN_WARNING pr_fmt(fmt), ...); */
pr_notice(fmt, ...); /* similar to printk(KERN_NOTICE pr_fmt(fmt), ...); */
pr_info(fmt, ...); /* similar to printk(KERN_INFO pr_fmt(fmt), ...); */
/* An example of Memory Allocation */
#include<linux/slab.h>
#include<linux/init.h>
#include<linux/module.h>
#include<linux/kernel.h>
#define size 10
MODULE_DESCRIPTION("example of memory allocation ");