Skip to content

Instantly share code, notes, and snippets.

@andres7293
andres7293 / suspend.ps1
Last active November 24, 2023 10:08
Suspend windows machine after specifing minutes and hours to wait before suspending
param(
[Parameter(Mandatory=$true)]
[int]$minutes,
[Parameter(Mandatory=$true)]
[int]$hours
)
$seconds = $hours * 3600 + $minutes * 60
@andres7293
andres7293 / producer-consumer-queue.cc
Last active October 27, 2023 14:57
Code snippet with elementary stuff needed to send messages throug a queue to a thread to dispatch tasks.
#include <iostream>
#include <thread>
#include <future>
#include <functional>
#include <queue>
#include <format>
#include <csignal>
using namespace std::chrono_literals;
#include <iostream>
#include <memory>
#include <cstdlib>
#include <vector>
template <class T>
class CustomAllocator { public:
using value_type = T;
using pointer = T*;
using const_pointer = const T*;
# Deployment mysql
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: mysql
spec:
replicas: 1
selector:
@andres7293
andres7293 / build.sh
Last active December 2, 2020 21:19
instrucciones compilación para compilador cruzado para raspberry pi con soporte para hardfloat
#!/bin/bash
INSTALL_DIR=/home/andres/pi
mkdir $INSTALL_DIR
mkdir -p $INSTALL_DIR/src $INSTALL_DIR/build
cd $INSTALL_DIR/src
#descargar paquetes
wget -nc https://ftp.gnu.org/gnu/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz
wget -nc https://ftp.gnu.org/gnu/glibc/glibc-2.31.tar.xz
wget -nc https://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.xz
void main(string[] args)
{
Console.WriteLine("Hello world!");
Console.ReadLine();
}