Skip to content

Instantly share code, notes, and snippets.

View HiroNakamura's full-sized avatar
馃彔
Working from home

Developer of interesting things HiroNakamura

馃彔
Working from home
View GitHub Profile
@bpmct
bpmct / coder_windows_build_guide.md
Created March 15, 2025 17:55
Building Coder on Windows - Guide and Automation Script

Building Coder on Windows - Complete Guide

This guide documents the process of setting up a Windows workspace using Coder and building the Coder repository on it.

Prerequisites

  • Access to a Coder deployment (e.g., dev.coder.com)
  • coder CLI installed and authenticated

Step 1: Create a Windows Workspace

@ASOIR
ASOIR / .deps...remix-tests...remix_accounts.sol
Created March 15, 2025 16:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
address[15] memory accounts;
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4;
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2;
@jranil
jranil / EventLogSummary.ps1
Created March 15, 2025 16:22
This PowerShell script analyzes Windows System event logs for the last 30 days and generates a CSV report showing the first and last event time for each day.
# Script to extract first and last event times from Windows System logs for the last 30 days
# For Temporary bypass (single session) run the command below
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Get current date for calculation
$today = Get-Date
$startDate = $today.AddDays(-30)
# Initialize array to store results
$results = @()
@DocBohn
DocBohn / pipe_demo.c
Last active March 16, 2025 18:21
Demonstration of using a pipe to communicate between processes
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
void fork_and_pipe(int *process, int *writing_fd, int *reading_fd0, int *reading_fd1, int *reading_fd2, int pipe_fd[4][2]);
void pipe_demo() {
int pipe_fd[4][2];
int process;
@DocBohn
DocBohn / fork_demo.c
Last active March 16, 2025 18:19
Demonstration of creating new processes and waiting for them to terminate
#include <stdio.h>
#include <unistd.h>
void fork_demo() {
pid_t pid;
printf("Before fork. \tme =%8d\tchild = n/a\tparent = %8d\n", getpid(), getppid());
pid = fork();
printf("After fork. \tme =%8d\tchild =%8d\tparent = %8d\n", getpid(), pid, getppid());
pid = fork();
printf("Another fork.\tme =%8d\tchild =%8d\tparent = %8d\n", getpid(), pid, getppid());
@sunmeat
sunmeat / main.cpp
Created March 15, 2025 15:46
OOP TCP + OOP-threads: SERVER SIDE
#define WIN32_LEAN_AND_MEAN
#include <iostream>
#include <windows.h>
#include <ws2tcpip.h>
#include <thread>
#include <memory>
#include <string>
using namespace std;
#pragma comment (lib, "Ws2_32.lib")
@sunmeat
sunmeat / main.cpp
Created March 15, 2025 15:33
TCP + threads: CLIENT SIDE
#define WIN32_LEAN_AND_MEAN
#include <iostream>
#include <windows.h>
#include <ws2tcpip.h>
using namespace std;
#pragma comment (lib, "Ws2_32.lib")
#pragma comment (lib, "Mswsock.lib")
#pragma comment (lib, "AdvApi32.lib")
@bouli
bouli / CONFIG.md
Created June 15, 2024 19:13 — forked from rdeavila/CONFIG.md
Apache: Como configurar um VirtualHost com proxy reverso

Apache: Como configurar um VirtualHost com proxy reverso

Instala biblioteca do Apache

sudo apt-get install libapache2-mod-proxy-html

Habilita os m贸dulos no Apache

@szero
szero / install_winget.ps1
Last active February 27, 2024 08:57
Simple script to install winget on Windows 10 and 11 systems, most usefull for people using privacy Windows tools that remove Microsoft Store (must be run with administrator privileges)
#Requires -RunAsAdministrator
Write-Output "Removing previous instances of winget..."
Get-AppxPackage -allUsers *desktopappinstaller* | Remove-AppxPackage
Get-AppxPackage -allUsers *winget* | Remove-AppxPackage
Write-Output "Getting information on latest winget release..."
#include <algorithm>
#include <array>
#include <chrono>
#include <cstdint>
#include <cstdio>
#include <random>
#include <vector>
using namespace std;
using namespace std::chrono;