Skip to content

Instantly share code, notes, and snippets.

View R3D9477's full-sized avatar

R3D9477 R3D9477

  • r3d9477@gmail.com
View GitHub Profile
@LumitoLuma
LumitoLuma / avr-gcc-build.sh
Last active November 10, 2021 08:44 — forked from ZakKemble/avr-gcc-build.sh
Build script for AVR-GCC. Forked from https://blog.zakkemble.net/avr-gcc-builds/
#!/bin/bash
# http://www.nongnu.org/avr-libc/user-manual/install_tools.html
# For optimum compile time this should generally be set to the number of CPU cores your machine has
JOBCOUNT=$(getconf _NPROCESSORS_ONLN)
# Build for Linux
# A Linux AVR-GCC toolchain is required to build a Windows toolchain
# If the Linux toolchain has already been built then you can set this to 0
Prerequisites
=============
- One Pinephone braveheart edition
- A micro SIM card or Nano sim with micro adapter
- A micro SD card (tested with SanDisk Ultra microSDXC UHS-1 64G)
- A 5V power adapter with regular usb connector (15 Watts recommended. 5V/3 amp)
- A Linux desktop/laptop to prepare the SD card (laptop used in this tutorial)
Preparation
@djarek
djarek / send_fd.cpp
Created December 6, 2018 01:59
send_fd.cpp
#include <boost/asio/coroutine.hpp>
#include <boost/asio/local/connect_pair.hpp>
#include <boost/asio/local/stream_protocol.hpp>
#include <iostream>
#include <sys/wait.h>
std::size_t
send_fd(boost::asio::local::stream_protocol::socket& socket,
int fd,
boost::system::error_code& ec)
@miguelmota
miguelmota / uint8_to_hex.cpp
Last active April 5, 2024 12:07
C++ uint8_t to hex string
#include <sstream>
#include <iostream>
#include <iomanip>
std::string uint8_to_hex_string(const uint8_t *v, const size_t s) {
std::stringstream ss;
ss << std::hex << std::setfill('0');
for (int i = 0; i < s; i++) {
@neeraj33negi
neeraj33negi / LRU_Cache.cpp
Created February 18, 2018 14:45
LRU Cache Implementation using C++ STL
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
//Create Global variable for cache size(total number of cache lines)
int cacheSize;
//Create Global data structures for cache and TLB lookup on heap
//Cache -> Queue
@Kuxe
Kuxe / node.hpp
Last active June 12, 2023 21:51
Generic tree class in C++ with some useful transforms
#ifndef NODE_HPP
#include <vector>
#include <stack>
#include <functional>
#include <list>
#include <iterator>
#include <type_traits>
/** A class representing an arbitrary tree **/
template<typename T>
@MichaelLawton
MichaelLawton / install-maya-2015-on-mint-18.1.sh
Last active August 27, 2023 17:41
Installing Maya 2015 SP6 on Linux Mint 18.1 Serena with Student License
# Installing Maya 2015 SP6 on Linux Mint 18.1 Serena with Student License
# This should work with later versions of Maya or different versions of Ubuntu [based] operating systems with a few changes.
# Don't run this as a script, instead copy and paste each line into your terminal
# Download link is from here: https://knowledge.autodesk.com/support/maya/downloads/caas/downloads/content/autodesk-maya-2015-service-pack-6.html
mkdir ~/maya2015_setup
cd ~/maya2015_setup
@rroohhh
rroohhh / client.sh
Created February 3, 2017 21:21
gstreamer udp audio streaming
#!/bin/bash
gst-launch-1.0 -v udpsrc uri=udp://239.1.1.1:5000 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)44100,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! autoaudiosink sync=false
@glampert
glampert / linear_allocator.cpp
Created November 13, 2016 21:15
Stack-like linear allocator - uses std::atomic to allow concurrent allocations from different threads.
// ============================================================================
// This code is in the Public Domain - I claim no copyrights over it.
// Use at your own leisure and risk.
//
// Compiled and tested with:
// c++ -std=c++11 -fno-exceptions -Wall -Wextra -pedantic -O3 linear_allocator.cpp
// ============================================================================
#include <cassert>
#include <cstdint>
@mohanraj-r
mohanraj-r / scp-speed-test.sh
Last active May 27, 2024 07:51
[speed test] Test ssh connection speed
#!/bin/bash
# scp-speed-test.sh
# Author: Alec Jacobson alecjacobsonATgmailDOTcom
# http://www.alecjacobson.com/weblog/?p=635
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
# ./scp-speed-test.sh user@hostname [test file size in kBs]