Skip to content

Instantly share code, notes, and snippets.

@planetceres
planetceres / RESET_USB_KERNEL_MODULE.md
Last active May 4, 2024 14:11
Restart/reset USB kernel module in Ubuntu 18.04 without rebooting
@smagiera
smagiera / gist:5c05853fd28bd9749511ec7fa956f486
Created January 18, 2019 10:09
modem config using networkd
# First, mask NetworkManager (if not done already)
systemctl mask NetworkManager
# Unmask, enable and start ModemManager
systemctl unmask ModemManager
systemctl enable ModemManager
systemctl start ModemManager
# Add a .network file for your modem network interface:
cat /etc/systemd/network/wwp0s20u6c2i12.network:
@neretin-trike
neretin-trike / pug.md
Last active May 21, 2024 23:00
Туториал по HTML препроцессору Pug (Jade)
@maditnerd
maditnerd / tc358743.sh
Last active March 25, 2022 13:40
Compile raspberry pi 3 kernel to add drivers (tc358743)
###########################
# bcm2835_unicam drivers #
###########################
# DESCRIPTION: Install bcm2835_unicam/tc358743 drivers from 6by9 Linux fork
# This should also work for adv7282m ov5647 (https://github.com/6by9/linux/commit/28ac7b3a2651d4b35204938e6c9ec2e4ba54c34e)
#
# CAUTION
# * Do not start this script! Copy/Paste each command.
# * Compilation will take over 1h30.
# * Any errors can potentially break the entire system
@klingtnet
klingtnet / lenovo-x1-carbon-5th-gen-fixes-arch-linux.md
Last active February 17, 2020 20:45
Lenovo X1 Carbon 5th Gen. (X1C5) Fixes for Arch Linux

Lenovo X1 Carbon 5th Gen. (X1C5) Fixes for Arch Linux

Almost everything of this awesome machine works out of the box. But, it is still bleeding edge hardware so not everything is already supported in the stable kernel. This list should help to fix the most annyoing problems, which are not much.

BIOS Update

Download the latest BIOS version for your model, visit pcsupport.lenovo.com, enter your products serial number (e.g. 20HR-), goto Drivers&Utilies and download the BIOS. I am not sure about the next step because Lenovo already provides a bootable CD image but I followed did run this instruction and the BIOS updated worked flawless, so here it is: geteltorito.pl -o converted.img n1mur10w.iso where n1mur10w.iso is the name of your bootable BIOS update image.

@cute
cute / ws-client.cpp
Created June 25, 2017 23:27 — forked from optman/ws-client.cpp
libevent websocket client test
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <event2/dns.h>
#include <arpa/inet.h>
#include <iostream>
using namespace std;
@jay
jay / ParseStream.c
Last active August 24, 2023 09:53
Parse a stream received by libcurl into sections.
/* Parse a stream received by libcurl into sections.
Usage: ParseStream
This program is the same as libcurl example getinmemory.c except that it also
parses the received data into sections.
A data section refers to attributes and data and is received in this format:
[[<4 bytes: attribute size><attributes><8 bytes: data size><data>]...]
@gokulkrishh
gokulkrishh / media-query.css
Last active May 17, 2024 04:45
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@h0tw1r3
h0tw1r3 / rtc-i2c
Last active July 9, 2022 14:37
Initializing I2C RTC (DS3231) on Raspberry PI bootup with Systemd without recompiling the kernel or devicetree support.
# /etc/conf.d/rtc-i2c
#
# My chip is actually a ds3231n, but ds1307 driver works fine (ds3232 does not!)
#
CHIP="ds1307"
ADDRESS="0x68"
BUS="1"
@denji
denji / nginx-tuning.md
Last active May 24, 2024 10:14
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.