Skip to content

Instantly share code, notes, and snippets.

View codebymikey's full-sized avatar

codebymikey codebymikey

View GitHub Profile
@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:
public static function check($checking_key, $data) {
try {
serialize($data);
}
catch (\Throwable $e) {
// The data fucked up. Go into it to see where.
ddm("CATCH $checking_key");
if (is_array($data)) {
foreach ($data as $key => $val) {
static::check($key, $val);
@taskylizard
taskylizard / fmhy.md
Last active November 16, 2024 07:02
/r/freemediaheckyeah, in one single file (view raw)
@petrov9
petrov9 / Readme.md
Last active August 3, 2024 15:46
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 October 23, 2024 14:32
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 August 23, 2024 03:19
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 November 14, 2024 09:14
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