Skip to content

Instantly share code, notes, and snippets.

View main.js
const HID = require("node-hid");
const vendorId = 4617;
const productId = 17185;
async function main() {
const device = new HID.HID(vendorId, productId);
device.on("error", (err) => {
defunctzombie /
Created Jul 5, 2016 — forked from wmealing/
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

defunctzombie / dell-3010cn.ppd
Created Dec 28, 2014
Dell 3010cn Postscript Printer Definition
View dell-3010cn.ppd
*PPD-Adobe: "4.3"
*% For information on using this, and to obtain the required backend
*% script, consult
*% This file is published under the GNU General Public License
*% PPD-O-MATIC (4.0.0 or newer) generated this PPD file. It is for use with
*% all programs and environments which use PPD files for dealing with
*% printer capability information. The printer must be configured with the
defunctzombie /
Last active Aug 29, 2015
working with upstream brances

Whenever you have a fork of a project which you intend to contribute, you will find it useful to stay up to date with the code from the upstream project you have cloned.

This can be easily accomplished by adding additional "remotes".

Using the repo as the base example.

Assuming you have forked the project on github and then cloned your fork locally.

defunctzombie / pin-stable
Last active Dec 11, 2015
Pinning stable release package on debian stable installs. Allows for selectively installing from backports or unstable for newer packages.
View pin-stable
# backports
# deb squeeze-backports main
# install from specific release
apt-get -t squeeze-backports install "package"
defunctzombie /
Last active Jul 18, 2021
browser field spec for package.json
defunctzombie / gist:1850854
Last active Sep 30, 2015
openssl csr given a key
View gist:1850854
/// generate a csr given a key
openssl req -new -key somefile.key -out somefile.csr
/// order of certificates for positive ssl chain
cat domain.crt PositiveSSLCA.crt UTNAddTrustServerCA.crt AddTrustExternalCARoot.crt > domain_chain.crt