Skip to content

Instantly share code, notes, and snippets.

@dbalabka
dbalabka / Installation.md
Last active July 16, 2024 17:04
Send notification from Windows WSL console similar to original Linux notify-send command 🎶🔔
  1. Create a file in C:\bin\toast.ps1 from source https://gist.github.com/dend/5ae8a70678e3a35d02ecd39c12f99110:
    curl https://gist.githubusercontent.com/dend/5ae8a70678e3a35d02ecd39c12f99110/raw -o /mnt/c/bin/toast.ps1
  2. Create ~/.local/bin/notify-send from the following source:
    powershell.exe "& { . C:\\bin\\toast.ps1; Show-Notification -ToastTitle \"$1\" -ToastText \"$2\" }"
    like this:
@petrov9
petrov9 / Readme.md
Last active April 22, 2024 06:43
Full logstash config with grok patterns. Grok pattern for Nginx, Tomcat, Spring

Below you can see the full work example for logstash.conf file

There are grok patterns for:
Nginx:
* access.log
* error.log
Tomcat:
* site.log
* localhost.log

  • site_access_log.txt
#!/usr/bin/env bash
#: Your comments here.
set -o errexit
set -o nounset
set -o pipefail
work_dir=$(dirname "$(readlink --canonicalize-existing "${0}" 2> /dev/null)")
readonly conf_file="${work_dir}/script.conf"
readonly error_reading_conf_file=80
readonly error_parsing_options=81
readonly script_name="${0##*/}"
@ourownstory
ourownstory / encrypted_dual_boot_xps_17.md
Last active June 19, 2024 13:58
Encrypted dual boot setup for Pop!_OS and Windows 10 using LUKS and Bitlocker on Dell XPS 17 9700

Encrypted dual boot setup with Pop!_OS and Windows 10

How to guide, using LUKS and Bitlocker on Dell XPS 17 9700

This guide is for those who want to use their XPS 17 in dual boot with their (preinstalled) Windows 10 and a new Pop!_OS installation, without giving up Bitlocker Encryption in Windows nor LUKS encryption in Linux.

The only guides that I could find were for Ubuntu, which it should be identical to, but I found the ommission of a few steps to resolve issues that I encountered in my first install attempt. Hoping to save you some trouble, I am sharing the steps that worked for me, linking the original guides that I found useful.

1. Preparation

  • 1.1 Of course: Backup all your data! You always do this when people tell you to, right? Maybe this time better be safe than sorry.
  • 1.2 Safely note your Bitlocker recovery key somewhere off your XPS. Where to find it
@dend
dend / toast.ps1
Last active July 16, 2024 17:05
Toast Notification in PowerShell
function Show-Notification {
[cmdletbinding()]
Param (
[string]
$ToastTitle,
[string]
[parameter(ValueFromPipeline)]
$ToastText
)
@gmolveau
gmolveau / docker_quick_run.sh
Last active June 14, 2024 20:34
Quickly run a temporary docker container and execute bash to try things (like a CI script)
docker run --rm -it -v $PWD:/tmp debian:10-slim /bin/bash
# --rm : remove after exit
# -it : interactive TTY
# -v : mount folder : current folder to /tmp folder of the container
# debian:10-slim : docker image https://git.io/JJzfy
# /bin/bash : run bash in this container
@ld100
ld100 / ArchLinuxWSL2.md
Last active July 16, 2024 10:24
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@me-vlad
me-vlad / Ansible_Vault_passwordstore.md
Last active July 28, 2021 19:01
Ansible Vault passwords and ansible_become_pass variable stored in pass (https://www.passwordstore.org) or gopass

Ansible Vault passwords and ansible_become_pass variable stored in pass https://www.passwordstore.org or gopass https://www.gopass.pw

ansible_become_pass variable in pass/gopass

Create encrypted password file with pass or gopass

pass insert ansible/test or gopass insert ansible/test

Now you can access become password stored in ansible/test using lookup plugin passwordstore

@x-yuri
x-yuri / docker-compose-anonymous.yml
Last active April 28, 2024 01:46
docker: migrate volume data #pg #docker
version: '3'
services:
s1:
image: postgres:12
container_name: ${prefix}_compose_anonymous
ports:
- $pg_port:5432
@HatScripts
HatScripts / codepen_jokes.md
Last active December 18, 2023 00:10
Programming jokes/one-liners found on CodePen
  • A Pen is worth a thousand docs.
  • Be the developer your linter thinks you are.
  • How do you comfort a JavaScript bug? You console it!
  • How would you React if I said I love Vue?
  • If a groundhog inspects their Web Component, do they see their Shadow DOM?
  • If you get tired, be like an AJAX request and REST.
  • If you want to flex your skills and go off the grid, try coding a layout with float.
  • Keep friends close and formatters closer.
  • Keep the <main> thing the <main> thing.
  • Knock knock! Race condition. Who's there?