Skip to content

Instantly share code, notes, and snippets.

View filviu's full-sized avatar

Silviu Vulcan filviu

View GitHub Profile
@filviu
filviu / gist:b90942bea74fe64c4a8d08231fea4591
Created September 22, 2020 13:22 — forked from trongthanh/gist:2779392
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.
@filviu
filviu / README.md
Last active April 29, 2022 18:31
Basic auth with pfSense and haproxy

If you want to add a basic auth to haproxy (on pfsense)

haproxy general settings

Global Advanced pass thru

userlist AuthRealmName
  user username password ENCRYPTED_PASSWORD_HERE
@filviu
filviu / README.md
Last active October 14, 2022 05:45 — forked from jpmens/github-mirror.py
Stefan expands on https://jpmens.net/2019/04/15/i-mirror-my-github-repositories-to-gitea/ I'm expanding on his work to mirror gists and starred repos and gists as well. I'm grouping those three in 4 different gitea organizations
# First define your dict:
nfsmounts:
- { path: "/mnt/nfs_mount", src: "192.168.0.55:/nfsshare" }
- { path: "/mnt/nfs_mount_2", src: "192.168.0.55:/nfsshare_2" }
# Shamelessly lifted from here:
# https://stackoverflow.com/questions/45387791/mount-different-shares-from-nfs-on-a-linux-os-using-ansible
# Then loop through it:
- name: mount the nfsshare in client side
@filviu
filviu / branch_fallback_Jenkinsfile
Last active February 5, 2020 13:08
Jenkins snippets
# checkout a repository with branch fallback
repos.split(',').each {
echo "Checking out ${it}"
dir("${it}"){
checkout resolveScm(
source: [
$class: 'GitSCMSource',
credentialsId: '51234-5678-9101-2131',
id: '_',
remote: "[email protected]:somebody/${it}.git",
@filviu
filviu / README.md
Last active December 8, 2020 08:33
Mount 9p virtio inside VM

Mount a host folder inside a VM using 9p virtio

/etc/initramfs-tools/modules

# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#
@filviu
filviu / datto.md
Last active September 5, 2019 11:39

If like me you bought a Datto Xeon-D Gigabyte motherboard here are some infos about them.

You can update at least the ipmi with stock gigabyte firmware

Also mine came with a BIOS password, I found this snippet online and indeed this was it:

By the way, if anyone bought one and needs the BIOS password, from my experience there's a 99.9% chance of it being either "R@str" or "Northern" or "NorthernLight$" (no quotes, caps as shown)

#!/usr/bin/env bash
# rmate
# Copyright (C) 2011-2018 by Harald Lapp <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@filviu
filviu / dark-slack.ps1
Last active June 4, 2019 09:42
Sets a dark mode for slack. Run once after each update without slack running.
$darkString = @'
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://cdn.jsdelivr.net/gh/laCour/slack-night-mode/css/raw/black.css',
success: function(css) {
let overrides = `
code { background-color: #535353; color: #85c5ff; } /* Change color: to whatever font color you want */
.c-mrkdwn__pre, .c-mrkdwn__quote { background: #535353 !important; background-color: #535353 !important; }
.p-threads_footer__input .p-message_input_field { background: #000 }
`
@filviu
filviu / sysadmin_by_doing_original.md
Last active December 11, 2019 05:47
Sysadmin by doing

Sysadmin by doing

This is what I tell people to do, who ask me "how do I learn to be a Linux sysadmin?"

  1. Set up a KVM hypervisor.
  2. Inside of that KVM hypervisor, install a Spacewalk server. Use CentOS 6 as the distro for all work below. (For bonus points, set up errata importation on the CentOS channels, so you can properly see security update advisory information.)
  3. Create a VM to provide named and dhcpd service to your entire environment. Set up the dhcp daemon to use the Spacewalk server as the pxeboot machine (thus allowing you to use Cobbler to do unattended OS installs). Make sure that every forward zone you create has a reverse zone associated with it. Use something like "internal.virtnet" (but not ".local") as your internal DNS zone.
  4. Use that Spacewalk server to automatically (without touching it) install a new pair of OS instances, with which you will then create a Master/Master pair of LDAP servers. Make sure they register with the Spacewalk server. Do not allow anonymous bind, do not u