Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hey-jude
hey-jude / x86_64-elf-gcc@7.rb
Created March 12, 2024 05:18
x86_64-elf-gcc 7 version for cross-compiling - pintos on ubuntu 18.04
class X8664ElfGccAT7 < Formula
desc "GNU compiler collection for x86_64-elf"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-7.5.0/gcc-7.5.0.tar.xz"
sha256 "b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661"
license "GPL-3.0-or-later" => { with: "GCC-exception-3.1" }
livecheck do
formula "gcc"
@hey-jude
hey-jude / x86_64-elf-gcc@11.rb
Created November 24, 2023 06:11
x86_64-elf-gcc 11 version for cross-compiling - pintos
class X8664ElfGccAT11 < Formula
desc "GNU compiler collection for x86_64-elf"
homepage "https://gcc.gnu.org"
url "https://ftp.gnu.org/gnu/gcc/gcc-11.4.0/gcc-11.4.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-11.4.0/gcc-11.4.0.tar.xz"
sha256 "3f2db222b007e8a4a23cd5ba56726ef08e8b1f1eb2055ee72c1402cea73a8dd9"
license "GPL-3.0-or-later" => { with: "GCC-exception-3.1" }
livecheck do
formula "gcc"
@hey-jude
hey-jude / ubuntu-16-04.yaml
Last active September 26, 2023 04:06
Lima templates for legacy ubuntu
# This template requires Lima v0.7.0 or later.
images:
# Fallback to the latest release image.
# Hint: run `limactl prune` to invalidate the cache
- location: "https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-arm64-disk1.img"
arch: "aarch64"
mounts:
@hey-jude
hey-jude / sql highliter
Last active April 18, 2022 06:15
Highlight & extract schema.table name from sql.
Highlight & extract schema.table name from sql.
The result is printed on the console page. (Click circle on Build History)
Source tables :
FROM ?
JOIN ?
Target tables :
CREATE TABLE ?
DROP/TRUNCATE TABLE ?
DELETE FROM ?
@hey-jude
hey-jude / syncDir.sh
Last active March 30, 2021 12:24
sync worker nodes (config passwordless ssh before exec.)
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "Usage: syncDir.sh <path>" >&2
exit 1
fi
ABS_PATH_COMMAND="readlink -f"
if [[ $(uname -s) = "Darwin" ]]
then
ABS_PATH_COMMAND="realpath"
@hey-jude
hey-jude / check-keydb.sh
Last active December 16, 2020 13:11
redis / keydb 프로세스 검사후 재시작 스크립트 : init.d / systemd를 쓸 수 없는 환경에서 crontab으로 대응하기 위해.
#!/bin/bash
pid=$(/usr/sbin/pidof keydb-server)
if [ -z "$pid" ]
then
#echo "\`pidof keydb-server\` is empty"
sleep 5
/bin/rm /log/puser/keydb/keydb_6379.pid
$HOME/keydb/etc/init.d/keydb-server start
#else
@hey-jude
hey-jude / yarn_stats_2.py
Last active October 23, 2020 12:58
Export yarn application resource usage to influxdb
import os
import sys
import subprocess
import json
import requests
import logging
from influxdb import InfluxDBClient
from influxdb.client import InfluxDBClientError
host=''
@hey-jude
hey-jude / redis-command-splitter.py
Last active August 29, 2020 16:05
split redis command data with key
#!/usr/bin/env python3
from __future__ import print_function
import sys
from argparse import ArgumentParser
from rediscluster import RedisCluster
from contextlib import ExitStack
def eprint(*args, **kwargs):
@hey-jude
hey-jude / rpm_instrumentation.rb
Last active January 14, 2016 08:04
instrumenting rabl rendering on newrelic rpm : config/initializers/rpm_instrumentation.rb
require 'new_relic/agent/method_tracer'
require 'grape-rabl/formatter'
# 0.3.1: Grape::Formatter::Rabl.call, master: Grape::Rabl::Formatter#render
Grape::Formatter::Rabl.class_eval do # class_eval creates instance methods
class << self
include ::NewRelic::Agent::MethodTracer
# https://github.com/ruby-grape/grape-rabl/blob/v0.3.1/lib/grape-rabl/formatter.rb
def call_with_newrelic(object, env)
rabl_path = env['api.tilt.rabl'] || env['api.endpoint'].options[:route_options][:rabl]