Skip to content

Instantly share code, notes, and snippets.

@wmealing
wmealing / C-states.md
Last active May 15, 2024 23:13
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:

@praseodym
praseodym / config.gateway.json
Created December 18, 2016 14:39
UniFi Security Gateway configuration
{
"firewall": {
"all-ping": "enable",
"broadcast-ping": "disable",
"group": {
"address-group": {
"authorized_guests": {
"description": "authorized guests MAC addresses"
},
"guest_allow_addresses": {

Cheat Sheet para o teste de EW

Setup do projeto

Criar servidor express.js

Para criar um servidor express.js para servir de API:

npx express-generator --no-view nome-do-projeto
@AlexVestin
AlexVestin / avio_write.c
Created August 18, 2018 17:22
Write to in memory buffert (avio_write.c example)
#include "avio_write.h"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/imgutils.h>
#include <libswresample/swresample.h>
#include <libavutil/opt.h>
struct buffer_data {
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 15, 2024 22:57
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@nerzhulart
nerzhulart / Windows Defender Exclusions for Developer.ps1
Last active May 15, 2024 22:55 — forked from dknoodle/Windows Defender Exclusions VS 2017.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@planemad
planemad / india_pc_2024_simplified.geojson
Last active May 15, 2024 22:55
India Parliamentary Constituencies Shape 2024
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quagliato
quagliato / select_estados.html
Last active May 15, 2024 22:54
<select> com todos os estados brasileiros
<select id="estado" name="estado">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@lyc8503
lyc8503 / Bilibili共享大会员.user.js
Last active May 15, 2024 22:54
和朋友共享 Bilibili 大会员账号
// ==UserScript==
// @name Bilibili VIP
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 不给叔叔送钱
// @author You
// @match *://www.bilibili.com/bangumi/play/*
// @match *://www.bilibili.com/video/*
// @connect api.bilibili.com
// @icon https://www.bilibili.com/favicon.ico
@mariadanieldeepak
mariadanieldeepak / downgrade-node.sh
Created July 6, 2019 01:18
Downgrade Node in Mac OS using Homebrew without messing dependencies
# Find existing version
node --version
# Search available Node versions.
brew search node
# I neeeded a version between > 10.0 < 11. So I chose node@10.
brew install node@10
# You can install multiple versions, but you cannot have them available all at once.