Skip to content

Instantly share code, notes, and snippets.

@asabla
asabla / Docker-run-commands
Created August 6, 2016 17:10
Docker Gitlab setup
docker run --name gitlab-postgresql -d \
--env 'DB_NAME=gitlabhq_production' \
--env 'DB_USER=gitlab' \
--env 'DB_PASS=DBPASSWORD' \
--volume /local/db/location/postgresql:/var/lib/postgresql \
sameersbn/postgresql
docker run --name gitlab-redis -d \
--volume /local/cache/location/redis:/var/lib/redis \
sameersbn/redis
@asabla
asabla / steps.sh
Last active December 2, 2016 07:07
Proxmox multiple public ip's @ online.net
# When you have access to proxmox web gui make sure you have all isos and fail over configured
# 1. Create a new new VM and set MAC the same as in the panel whilst handling fail over ips
# 2. Boot up the machine and go through the installation (skip networking part)
# 3. After installation login into the machine with VNC (through proxmox)
# 4. edit /etc/network/interface and add this:
auto lo ens18
iface li inet loopback
iface ens18 inet static
@asabla
asabla / hosts
Created January 22, 2017 15:25
Blocking ads etc
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
@asabla
asabla / genesis_public_key
Created February 22, 2018 10:35
genesis_public_key
04c75c50c48cfad492d28ce4466cc9a21e4ccbed5baffb4d73c9a6c34a325800872a32a433cc260b56f2dd420edadc15c3e60ba04cee47349c0eb36ea5892e5b03
@asabla
asabla / digitalocean-dns-challenge
Last active May 11, 2018 10:29
Docker certbot examples
docker run -it --name certbot \
-v <certs>:/etc/letsencrypt \
-v <logs>:/var/lib/letsencrypt \
-v <do-secret>:/.secrets \
certbot/dns-digitalocean certonly \
--agree-tos \
--dns-digitalocean \
--dns-digitalocean-credentials /.secrets/do-token.ini \
--dns-digitalocean-propagation-seconds 60 \
--preferred-challenges dns-01 \
@asabla
asabla / installation.ps1
Created September 12, 2019 08:51
Small Powershell script to create a local instance of Microsoft ServiceBus
# Reference: https://docs.microsoft.com/en-us/previous-versions/azure/jj193022(v=azure.10)?redirectedfrom=MSDN
# Before you can get started, you'll have to install the service it self with Web Platform installer.
# A direct link to binary it self can be found on the page from reference link.
# Prerequisites
# 1. Make sure you have SQL Express installed (at least 2012)
# 2. Make sure you have installed the service it self (it won't start until configured)
# You can verify this by looking for 'Windows Fabric Host Service' amongst windows services.
@asabla
asabla / old-notes.txt
Created September 24, 2020 20:48
Network troubleshooting notes
Network troubleshooting
1. Check /etc/sysctl.conf
Specifically:
* net.core.netdev_max_backlog
* net.core.rmem_max
* net.core.rmem_default
Example values for default:
* net.core.netdev_max_backlog = 1000
* net.core.rmem_max = 131071
* net.core.rmem_default = 163480
@asabla
asabla / .bashrc
Created April 23, 2021 18:29
Prune old git branches
func_gitprune() {
echo 'Starting git prune'
echo "Found $(git branch | wc -l) number of local branches"
echo "Starts prune of origin branches...."
git remote prune origin
echo "Local branches which can be removed:"
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}'
@asabla
asabla / check-windows-update-install-date.ps1
Created May 2, 2021 19:56
Find and list windows updates through powershell
Get-ChildItem -Path HKLM:\System\Setup\Source* | ForEach-Object {Get-ItemProperty -Path Registry::$_} | Select-Object ProductName, ReleaseID, CurrentBuild, @{n="Install Date"; e={([DateTime]'1/1/1970').AddSeconds($_.InstallDate)}} | Sort-Object "Install Date"
@asabla
asabla / list-duplicated-files.ps1
Last active June 14, 2021 19:23
Find duplicated files with powershell
Get-ChildItem -Recurse -File |
Group-Object Length |
Where-Object { $_.Count -gt 1 } |
select -ExpandProperty group |
foreach { Get-FileHash -LiteralPath $_.FullName } |
group -Property hash |
where { $_.count -gt 1 } |
select -ExpandProperty group