Skip to content

Instantly share code, notes, and snippets.

View pradykaushik's full-sized avatar
😰
Watt is our problem!

PRADYUMNA KAUSHIK pradykaushik

😰
Watt is our problem!
View GitHub Profile
@tjunghans
tjunghans / increase-ulimit-on-systemd-service.md
Last active January 11, 2022 03:36
Increase ulimit on a systemd service

Increase ulimit on a systemd service

Locate the service under /etc/systemd/system and edit it with vim. Add the following to the [Service] section of the file:

LimitNOFILE=65536

This is the equivalent of ulimit -n.

@SriramKeerthi
SriramKeerthi / Load.java
Last active September 27, 2022 09:25
Simple CPU Load Generator in Java
package com.caffinc.grex.core;
/**
* SPDX-License-Identifier: MIT
*
* Generates Load on the CPU by keeping it busy for the given load percentage
* @author Sriram
*/
public class Load {
/**
@rayrutjes
rayrutjes / detectcontenttype.go
Created December 12, 2015 13:36
golang detect content type of a file
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
// Only the first 512 bytes are used to sniff the content type.
buffer := make([]byte, 512)
_, err = file.Read(buffer)
if err != nil {