Skip to content

Instantly share code, notes, and snippets.

View nardhar's full-sized avatar

Felix Carreño B. nardhar

View GitHub Profile
@nardhar
nardhar / .gitattributes
Created November 13, 2020 20:04 — forked from Klooven/about.md
Custom Bootstrap CSS creator
# YOU MAY SKIP THIS FILE
# Suppress diff for generated files
build/* linguist-generated=true
@nardhar
nardhar / debian-disable-touchscreen.md
Last active December 16, 2019 20:42
Disable Touch display functionality from DELL XPS laptop for Debian 9

First install xinput

$ sudo apt-get install xinput

Find the touchscreen display

$ xinput --list
@nardhar
nardhar / git-deploy-key.md
Last active September 4, 2019 03:49
guide for adding a git deploy key to server, for not adding a user (or using your own account)

Git add deploy key

Note: this only works when your cloned repo uses SSH url, e.g.: git@domain.com:group/repository.git

Tested in Debian with GitLab

Steps

  1. Generate ssh key for repo and enter another filename (not the default one) for saving the key, e.g: /home/user/.ssh/id_rsa_my_repo
@nardhar
nardhar / ntfs-fix-reboot.md
Created July 17, 2019 03:48
Fix NTFS drive after reboot

If /etc/fstab drive is read only mode after reboot then follow these steps:

NOTE: ntfsfix must be installed

sudo fdisk -l
sudo umount /dev/sdb1
sudo ntfsfix /dev/sdb1
sudo mount -a
@nardhar
nardhar / vertx-eventbus-consumer-verticle.md
Created November 7, 2018 21:03
Simple vertx verticle for DRYish registering of EventBus consumers

The abstract class that should be extended instead of AbstractVerticle

package org.nardhar.vertx.examples;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.CompositeFuture;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.Message;
@nardhar
nardhar / format-pendrive.md
Created September 5, 2018 16:09
format pendrive in linux

find usb drive

sudo fdisk -l

umount it

sudo umount /dev/sdxY

format it

@nardhar
nardhar / best-practices.md
Created July 30, 2018 13:10
Recommended Best Practices
@nardhar
nardhar / userChrome.css
Created May 8, 2018 21:12
Firefox 58+ Multiple line tabs
/* Firefox type in urlbar about:support */
/* and click in Open Folder at Profile Folder line */
/* Create folder chrome and copy this file there */
/**
All credits for this file go to https://www.reddit.com/r/firefox/comments/726p8u/multirow_tabs_firefox_ignores_mozboxflex/dngb8qf/
*/
.tabbrowser-tab:not([pinned]) {
flex-grow:1;
min-width:150px;
@nardhar
nardhar / encryption.js
Created December 22, 2017 19:36 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
@nardhar
nardhar / shouldjs-plugin-idea.js
Last active September 13, 2017 20:07
node js Test Server Should idea
// Is there something like this?
const RequestTest = require('should-request-test');
describe('Starting controller testing', () => {
// calling the express app
const server = require('src/index');
// controller endpoint
const endpoint = '/api/v1/myResource';
const requestTest;