Skip to content

Instantly share code, notes, and snippets.

View yisonPylkita's full-sized avatar
👻
Just a normal, beautiful day

Wojciech Bartnik yisonPylkita

👻
Just a normal, beautiful day
  • Warsaw, Poland
View GitHub Profile
@ghedo
ghedo / sound_playback.c
Last active June 19, 2024 02:00
Simple sound playback using ALSA API and libasound
/*
* Simple sound playback using ALSA API and libasound.
*
* Compile:
* $ cc -o play sound_playback.c -lasound
*
* Usage:
* $ ./play <sample_rate> <channels> <seconds> < <file>
*
* Examples:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 13, 2024 14:35
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wandernauta
wandernauta / sp
Last active July 10, 2024 07:57
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@kylemanna
kylemanna / README-python-service-on-systemd-activated-socket.md
Last active July 2, 2024 10:30 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.

@alfredkrohmer
alfredkrohmer / xbox-one-wireless-protocol.md
Created November 23, 2016 21:52
XBox One Wireless Controller Protocol

Physical layer

The dongle itself is sending out data using 802.11a (5 GHz WiFi) with OFDM and 6 Mbit/s data rate:

Radiotap Header v0, Length 38
    Header revision: 0
    Header pad: 0
    Header length: 38
    Present flags
@mjuric
mjuric / kafka-useful-commands.md
Last active May 24, 2024 14:06
Useful Kafka wrangling commands

Utilities you'll care about

All these are already installed on epyc.

  • kafkacat (conda install -c conda-forge kafkacat)

  • kt (grab it from https://github.com/fgeller/kt/releases)

  • kafka-* (come with kafka, if you yum install if from Confluent's repo, or via Docker if you're so inclined). Warning -- JVM based and dreadfully slow.

  • jq (conda install -c conda-forge jq or use your favorite package manager)

@yisonPylkita
yisonPylkita / byte_converter.hpp
Created October 18, 2018 17:41
Loading uint16_6 and uint32_t from little/big endian memory
#pragma once
#include <cstdint>
#if !defined(__ORDER_LITTLE_ENDIAN__)
#error "Only little endian systems are supported"
#endif
// All of these functions are constexpr (c++11 compatibile and above)
// Generated code - https://godbolt.org/z/Tz7Wvg
namespace byte_converter {
@ayufan
ayufan / pinebookpro-power-usage.txt
Last active December 24, 2022 19:09
Pinebook Pro Power Usage
100% brightness - 7W
40% brightness - 4.8W
0% brightness - 3.5W
0% brightness, all cores - 8.5W
100% brightness, all cores - 12.2W
40% brightness, youtube 480p, vp9 - 7.3W
40% brightness, youtube 720p, drop frames, vp9 - 10W
40% brightness, youtube 1080p, choppy, vp9 - 10W
40% brightness, youtube 480p, avc1 - 6.7W
40% brightness, youtube 720p, avc1 - 7W