Skip to content

Instantly share code, notes, and snippets.

@prahal
prahal / cpufreq-switching-2.c
Created April 24, 2024 21:36
Test cpufrequency switching for rk3399 big CPUs with no delay between transitions
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/mman.h>
#define MAIN_LOOPS (100)
@prahal
prahal / cpufreq-switching-2-delay5msec.c
Last active April 24, 2024 21:35
Test cpufrequency switching for rk3399 big CPUs with 5msec delay between transitions
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/mman.h>
#define MAIN_LOOPS (100)
@prahal
prahal / cpufreq-switching.c
Last active April 19, 2024 22:11
test cpufrequency min/max switching for big little RK3399
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
#include <malloc.h>
#include <unistd.h>
#include <sys/mman.h>
#define MAIN_LOOPS (100)
#define TRIALS_PER_TOGGLE (10)
@prahal
prahal / devolo-updates
Created June 14, 2023 20:48
devolo-dlan-cockpit /etc/cron.d/devolo-updates updated to new key management : put its key in /usr/share/keyrings/devolo-ag.gpg and add the proper signed-by to its apt sources file
#!/bin/sh
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script was part of the google-chrome package and has been adapted
# be devolo AG.
#
# It creates the repository configuration file for package updates, and it
@prahal
prahal / super-double-sprat.rb
Created April 17, 2022 01:41
cannot convert hash to keyword arguments in super - wrong number of arguments error
class Base
attr_reader :gitolite_config, :repository, :context, :options
def initialize(gitolite_config, repository, context, **options)
@gitolite_config = gitolite_config
@repository = repository
@context = context
@options = options.dup
@old_perms = {}
end
@prahal
prahal / repro-1501.sh
Created November 13, 2021 19:28
Sample repro script for bundler issues
#!/bin/bash
set -ex
mkdir -p /tmp/repro-1501
cd /tmp/repro-1501
bundle config set --local without 'development'
bundle env
@prahal
prahal / virtual_serial_ports.md
Created March 19, 2018 09:50 — forked from CMCDragonkai/virtual_serial_ports.md
Virtual Serial Ports #cli #serial #network

Virtual Serial Ports

We can use socat to create 2 virtual serial ports that are connected to each other locally. This can be useful for debugging serial port applications. Or simulating serial port communication. Or running 2 legacy programs that only communicate with each other over serial ports, such as old DOS games. And of course, for education, since serial communication is probably the most simple communication protocol there is, RS232 is considered at the bottom of the OSI stack, at the "Physical Layer". See: http://electronics.stackexchange.com/questions/31171/internet-vs-serial-communication

@prahal
prahal / shift2red-mutter.sh
Last active April 3, 2017 22:56
gnome mutter light night script
#!/bin/bash
# Based on https://github.com/jonls/redshift src/colorramp.c and src/gamma-randr
# and https://www.opengl.org/discussion_boards/showthread.php/146812-Gamma-correction-table
# requirements : bash >= 4.3 (nameref)
# mutter wayland compositor
# usage:
# script <action> <temperature mode> <gamma settings>
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.2.0-rc3 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
CONFIG_MIGHT_HAVE_PCI=y
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.18.0-rc3 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
CONFIG_MIGHT_HAVE_PCI=y