Skip to content

Instantly share code, notes, and snippets.

View holms's full-sized avatar

Roman Gorodeckij holms

View GitHub Profile
@holms
holms / gist:5005629
Last active December 21, 2023 16:10
midnight commander dark color theme
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this:
[Colors]
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black
@holms
holms / install-metasploit-osx.md
Last active August 19, 2023 19:12
Install Metasploit with Armitage on OSX Maverics
@holms
holms / gist:00f40cb0e9cdd328b563
Last active June 22, 2023 17:33
if domain's ip changed
1) Sync the files and databases with the new server.
2) Perform a re-sync just before cut-off.
3) Change the DNS to point to the new server.
4) Forward the request coming to the old ip to the new server until DNS propagation completes.
Here's how I would do the step 4:
@holms
holms / do-db-psql.tf
Created April 17, 2023 16:35
Terraform Digital Ocean Postgresql Database Cluster
resource "digitalocean_vpc" "myvpc" {
name = "myvpc"
region = "fra1"
ip_range = "10.10.10.0/24"
}
resource "digitalocean_database_cluster" "mycluster" {
name = "mycluster"
engine = "pg"
version = "14"
@holms
holms / az-pgsql.tf
Last active April 17, 2023 15:53
terraform azure postgresql flexible server
resource "azurerm_postgresql_flexible_server" "mydb" {
name = "pbs-northeurope"
location = azurerm_resource_group.mycompany.location
resource_group_name = azurerm_resource_group.mycompany.name
administrator_login = "psqladmin"
administrator_password = "mypassword"
sku_name = "MO_Standard_E4s_v3"
version = "12"
@holms
holms / gist:f6248de0bf3dcbcb956162d08562af7e
Created December 27, 2022 03:06
Kusto - provision database with terraform from local file
resource "azurerm_kusto_script" "example" {
name = "example-script"
database_name = azurerm_kusto_database.example.name
cluster_name = azurerm_kusto_cluster.example.name
content_script = file("path/to/script.csl")
force_an_update_when_value_changed = md5(file("path/to/script.csl"))
}
@holms
holms / mbr2gpt.md
Last active March 20, 2022 16:39
Create GPT partition table and Create logical volumes

Create GPT partition table

Sorry but you HAVE to go with rescue disk.

parted /dev/sdb
(parted) mklabel gpt
(parted) mkpart primary 0GB 100%
(parted) print
@holms
holms / gist:4507731
Created January 11, 2013 03:33
FreeBSD: High resolution console
cd /usr/src/sys/amd64/conf
vi GENERIC #:
options VESA # Build VESA module into kernel
options SC_PIXEL_MODE # Allows syscons to act on pixels rather than text
cd /usr/src
make buildkernel KERNCONF=GENERIC
make installkernel KERNCONF=GENERIC
reboot
@holms
holms / install-metasploit-debian.md
Last active October 10, 2020 14:13
metasploit install in debian wheezy

Debian Wheezy Metasploit Setup

Install depedencies

apt-get install build-essential libreadline-dev libssl-dev libpq5 libpq-dev libreadline5 libsqlite3-dev libpcap-dev openjdk-7-jre subversion git-core autoconf postgresql pgadmin3 curl zlib1g-dev libxml2-dev libxslt1-dev vncviewer libyaml-dev ruby1.9.3 nmap -y
gem install --verbose --debug pcaprub wirble pg sqlite3 msgpack activerecord redcarpet rspec simplecov yard bundler
@holms
holms / client.go
Created March 6, 2020 12:55
go problem
package aerospike_shared
import (
"bytes"
"fmt"
"log"
"math"
"os"
"runtime"
"strconv"