Skip to content

Instantly share code, notes, and snippets.

@efenfauzi
efenfauzi / haproxy.cfg
Last active August 2, 2024 06:40
haproxy + traefik docker get real ip from options xforwardedfor
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
@rkttu
rkttu / Dockerfile
Last active April 14, 2025 04:55
Run Office 2019 in Windows Full Container (19H1)
FROM mcr.microsoft.com/windows:1903 AS build
WORKDIR C:\\odtsetup
ADD https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_11617-33601.exe odtsetup.exe
RUN odtsetup.exe /quiet /norestart /extract:C:\\odtsetup
FROM mcr.microsoft.com/windows:1903 AS download
WORKDIR C:\\odtsetup
COPY --from=build C:\\odtsetup\\setup.exe .
alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Add an "alert" alias for long running commands. Use like so:
@adanacs
adanacs / gist:80ea61edc1240d25c7d8d144f6e6608d
Last active March 5, 2024 06:15
Setup Git on WD My Cloud EX2 Ultra

--Setup Git on WD My Cloud EX2 Ultra

  • Turn on SSH
  • Install Git (Hi, just download git from EX2 repository - http://downloads.wdc.com/apps/WDMyCloudEX2/git/WDMyCloudEX2_git_1.40.bin55 open it in HEX editor - and change 4B 69 6E 67 73 43 61 5A (KingsCaZ) to 47 72 61 6E 64 54 65 5A (GrandTeZ) at first string. Save it, and then do install it over "Install an app manually" link in AppStore tab.
  • Create repo folder and make group writeable
  • Create a user and add to group
  • Update user account to point to user share folder
  • Create SSH Key and copy .pub to /shares/user/.ssh/authorized_keys
  • Set permissions cd /shares/user; chown user . ; chmod 0755 . ; chown -R user .ssh ; chmod go-rw -R .ssh
@zulhfreelancer
zulhfreelancer / install-docker.md
Last active March 22, 2025 14:30
Install Docker oneliner script

Just install Docker

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Install Docker and Rancher Server

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh && sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

@georgy7
georgy7 / extract_mbox_attachments.py
Last active April 24, 2025 04:37
Extract attachments from mbox file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modified.
# Original script source:
# http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# https://web.archive.org/web/20150312172727/http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html
# Usage:
# Run the script from a folder with file "all.mbox"