Skip to content

Instantly share code, notes, and snippets.

View arusahni's full-sized avatar

Aru Sahni arusahni

View GitHub Profile
@slugonamission
slugonamission / Archer-top
Last active March 3, 2016 23:19
Adding "99 problems, 0 bitches" to top's Tasks line
=============== START OF DIFF ========================
--- temp/procps-3.2.8/top.h 2006-06-25 07:41:48.000000000 +0100
+++ procps-3.2.8/top.h 2013-02-25 22:56:29.000000000 +0000
@@ -382,7 +382,7 @@
#define LOADAV_line "%s -%s\n"
#define LOADAV_line_alt "%s\06 -%s\n"
#define STATES_line1 "Tasks:\03" \
- " %3u \02total,\03 %3u \02running,\03 %3u \02sleeping,\03 %3u \02stopped,\03 %3u \02zombie\03\n"
+ " %3u \02total,\03 %3u \02running,\03 %3u \02sleeping,\03 %3u \02stopped,\03 %3u \02zombie,\03 99 \02problems,\03 0 \02bitches\03\n"
@ivoarch
ivoarch / .dircolors
Last active February 16, 2020 09:54
Zenburn color theme for .dircolors!
# Zenburn color theme for the color GNU ls utility.
# Ivaylo Kuzev <[email protected]>, 2014
Moved to https://github.com/ivoarch/dircolors-zenburn
@dpapathanasiou
dpapathanasiou / SchemaSpy-HOWTO.md
Last active February 17, 2024 19:45
How to use SchemaSpy to generate the db schema diagram for a PostgreSQL database

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is v6.1.0)

  2. Get the PostgreSQL JDBC driver (unless your installed version of java is really old, use the latest JDBC4 jar file)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one:

@dustin-graham
dustin-graham / ApiService.java
Created February 15, 2015 06:17
Infinite Scrolling Android RecyclerView with RxJava
public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) {
return Observable.create(new Observable.OnSubscribe<List<String>>() {
@Override
public void call(final Subscriber<? super List<String>> subscriber) {
onNextObservable.subscribe(new Observer<Void>() {
int latestPage = -1;
@Override
public void onCompleted() {
subscriber.onCompleted();
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active October 26, 2024 16:38
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@brandonroberts
brandonroberts / async-ng-module-loader.ts
Last active April 26, 2019 12:40
Webpack Async NgModule Loader
import {Injectable, NgModuleFactory, NgModuleFactoryLoader, Compiler, Type} from '@angular/core';
class LoaderCallback {
constructor(public callback) {}
}
export let load: Type = (callback: Function) => {
return new LoaderCallback(callback);
};
@roman-yepishev
roman-yepishev / dell-os-recovery-linux-mini-howto.md
Last active September 17, 2023 14:13
Dell OS Recovery Tool under Linux Mini-HOWTO

Dell OS Recovery Tool Under Linux Mini-HOWTO

Since I was unable to find a specific answer to how can one create a Dell recovery disk from within Linux, I decided to write the steps here.

If you write the CD image directly to the USB drive (or create a new partition and write it there), the laptop will not boot. You need your USB media to be in FAT32 format with the contents of the recovery ISO.

  1. Download the recovery ISO from the support section of Dell website.
  2. Insert a USB Drive with enough capacity to hold the contents of the ISO image.
  3. Format the drive and create a filesystem where $USB_DEVICE is your USB drive (check with fdisk -l, it may be
@dvergeylen
dvergeylen / README.md
Last active April 3, 2024 16:27
JSQrcode library tutorial

Introduction

This tutorial is a step by step guide on how to use the javascript QR Code scanner on a webcam video stream in browser. Some people reported experiencing problems including it in their own projets so I guess a tutorial might help others.

Step 1: Include library in <head> section

<html lang="en">
  <head>
    <script type="text/javascript" src="grid.js"></script>
    <script type="text/javascript" src="version.js"></script>
    <script type="text/javascript" src="detector.js"></script>
[Unit]
Description=Restart trackpad after suspend
After=basic.target suspend.target hibernate.target
[Service]
User=root
Environment=DISPLAY=:0
ExecStart=/usr/bin/restart-trackpad
[Install]
#!/bin/bash
modprobe -r psmouse && modprobe psmouse