This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# Strict Mode and Tracing | |
set -e | |
set -u | |
if set -q TRACE; and test "$TRACE" = 1 | |
set -x | |
end | |
# Help Message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# cat life.txt | fml.py -n 10 | |
import sys | |
import argparse | |
def process_stream(n): | |
lines = [] | |
for line in sys.stdin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sqlite3 | |
import click | |
import json | |
import os | |
def remove_periods(text): | |
return re.sub(r'\.+', ' ', text).strip() | |
def lowercase_sanitize(value): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Schedule VM shutdown and server reboot | |
hosts: kvm_servers | |
become: yes | |
vars: | |
shutdown_time: "23:00" | |
tasks: | |
- name: Create a cron job to shutdown VMs and reboot server | |
cron: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible-playbook -i your_inventory_file schedule_shutdown_and_reboot.yml | |
```yaml | |
--- | |
- name: Schedule VM shutdown and server reboot | |
hosts: kvm_servers | |
become: yes | |
vars: | |
shutdown_time: "23:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# default verbose | |
import os | |
import time | |
from pathlib import Path | |
def convert_fish_to_zsh_history(): | |
fish_history_path = Path.home() / '.local/share/fish/fish_history' | |
zsh_history_path = Path.home() / '.zsh_history' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import yaml | |
import dns.resolver | |
# Load the YAML file | |
with open('dns_tests.yaml', 'r') as file: | |
test_cases = yaml.safe_load(file) | |
class TestDNSLookup(unittest.TestCase): | |
def dns_lookup(self, host, record_type): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Catppuccin Mocha Theme for Kagi */ | |
.search-input-container { | |
position: relative; | |
width: 100%; | |
color: #d9e0ee; | |
background-color: #1e1e2e; | |
border-radius: 2rem !important; | |
border: 1px solid #f5c2e7 !important; | |
transition-duration: 0.2s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Pipeline | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "Colmena nixflake demo"; | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
colmena.url = "github:zhaofengli/colmena"; | |
}; | |
outputs = { self, nixpkgs, flake-utils, colmena }: |
NewerOlder