Skip to content

Instantly share code, notes, and snippets.

View gnull's full-sized avatar
💭
I moved from Github to Sourcehut and suggest you do the same

Ivan Oleynikov gnull

💭
I moved from Github to Sourcehut and suggest you do the same
View GitHub Profile
#/bin/bash
########################################
## CC BY-NC-SA 4.0 ##
## Original script by Peter Nerlich ##
## This code is provided as-is, you ##
## are responsible for anything you ##
## do with it and the consequences. ##
########################################
@puncoz
puncoz / arch-missing-keyring.md
Last active January 2, 2024 19:59
Arch Linux: missing keyring issue on updates

error: key "CEB167EFB5722BD6" could not be looked up remotely error: required key missing from keyring error: failed to commit transaction (unexpected error)

$ sudo pacman-key --lsign-key CEB167EFB5722BD6

if this gives error ERROR: CEB167EFB5722BD6 could not be locally signed.

$ sudo pacman-key --refresh-keys

# ~/.asoundrc or /etc/asound.conf
# ALSA configuration file
##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
# device names ad described in the next section.
##### DEVICE NAMES #####
@pavel-odintsov
pavel-odintsov / irq_balance_habrahabr.sh
Created June 25, 2015 12:25
irq_balance_habrahabr.sh
#!/bin/bash
# from http://habrahabr.ru/post/108240/
ncpus=`grep -ciw ^processor /proc/cpuinfo`
test "$ncpus" -gt 1 || exit 1
n=0
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g`
do
f="/proc/irq/$irq/smp_affinity"
@pavel-odintsov
pavel-odintsov / pps.sh
Last active August 27, 2023 20:21
Simple script to print packet rate for interface
#!/bin/bash
# Interval of calculation in seconds
INTERVAL="1"
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
echo e.g. $0 eth0
@pavel-odintsov
pavel-odintsov / af_packet_rx_ring.c
Last active June 27, 2024 19:28
af_packet_rx_ring_habrahabr.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <boost/thread.hpp>
#include <sys/mman.h>
#include <poll.h>
#include <arpa/inet.h>
@jvcasillas
jvcasillas / beamer-arrows-tikz.tex
Created November 19, 2012 15:25
beamer-arrows-in-itemize
\tikzstyle{every picture}+=[remember picture]
\everymath{\displaystyle}
\begin{frame}[m]\frametitle{}
\tikzstyle{na} = [baseline=-.5ex]
\begin{itemize}[<+-| alert@+>] % makes everything red
\item Sujeto
\tikz[na] \node[coordinate] (n1) {};
@austinmarton
austinmarton / recvRawEth.c
Created June 3, 2012 07:55
Receive raw Ethernet frames in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/ip.h>
@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>