Skip to content

Instantly share code, notes, and snippets.

View Prototype-X's full-sized avatar

Maxim Prototype-X

View GitHub Profile
@Prototype-X
Prototype-X / firstboot.sh.erb
Created August 20, 2023 19:40 — forked from slattery/firstboot.sh.erb
Generator for Debian preseed files
#!/bin/sh
# set hostname
echo <%= hostname %> > /etc/hostname
/etc/init.d/hostname.sh
# Set up networking
cat > /etc/network/interfaces << EOF
# The loopback network interface
auto lo
@Prototype-X
Prototype-X / README.md
Created December 15, 2022 09:35 — forked from kiler129/README.md
Run iLO remote console from shell

iLO Remote Console

This small script lets you start iLO Java-based console from shell.

But why not HTML5?

  • iLO 2/3 doesn't have HTML5 console
  • Mounting local (from the client computer) ISOs is PAINFULLY slow via HTML5 client

TL;DR

If you just start it, it will ask you for everything:

@Prototype-X
Prototype-X / ssh_tunnels.sh
Last active July 21, 2022 20:08 — forked from billautomata/ssh_tunnels.sh
ssh port forwarding cheatsheet
# local port forwarding
# the target host 192.168.0.100 is running a service on port 8888
# and you want that service available on the localhost port 7777
ssh -L 7777:localhost:8888 user@192.168.0.100
# remote port forwarding
# you are running a service on localhost port 9999
# and you want that service available on the target host 192.168.0.100 port 12340
@Prototype-X
Prototype-X / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Last active January 30, 2022 23:24
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@Prototype-X
Prototype-X / resource_alloc_docker.md
Created January 3, 2022 16:50 — forked from afolarin/resource_alloc_docker.md
Resource Allocation in Docker

#Container Resource Allocation Options in docker-run

now see: https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources

You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

##Dynamic CPU Allocation -c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

@Prototype-X
Prototype-X / latency.txt
Created June 10, 2021 10:26 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@Prototype-X
Prototype-X / PVE-HP-ssacli-smart-storage-admin.md
Created April 27, 2021 09:28 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@Prototype-X
Prototype-X / metrials-go.md
Created January 30, 2021 20:01 — forked from egorsmkv/metrials-go.md
Материалы по Go (golang): мануалы, статьи, книги и ссылки на сообщества

Материалы по Go (golang)

На русском языке

Мануалы и туториалы

  • [Введение в программирование на Go][1]
  • [Маленькая книга о Go][3]
  • [Эффективный Go][2]
  • Есть еще [Краткий пересказ Effective Go на русском языке][4], но 2009 года
@Prototype-X
Prototype-X / upgrade-postgres-9.5-to-9.6.md
Last active January 14, 2021 20:03 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04

TL;DR

Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main

Set db path for pg_upgradecluster:

@Prototype-X
Prototype-X / zabbix_cleanup.sql
Created October 19, 2020 13:43 — forked from edtjones/zabbix_cleanup.sql
Clean up zabbix database
SET @history_interval = 7;
SET @trends_interval = 90;
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);