This file contains hidden or 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
| package main | |
| import ( | |
| "log" | |
| "os" | |
| ) | |
| func main() { | |
| emptyFile, err := os.Create("emptyFile.txt") | |
| if err != nil { |
This file contains hidden or 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
| // This file was initially generated by Windows Terminal 1.3.2651.0 | |
| // Version: Oct 26, 2020 jake541 @ gmail.com | |
| // To view the default settings, hold "alt" while clicking on the "Settings" button. | |
| // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", | |
| "defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", |
This file contains hidden or 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
| select a.* from ( | |
| select | |
| [id], | |
| [User_Name], | |
| [Client_IP_Address], | |
| [Called_Station_Id], | |
| [Packet_Type], | |
| [Reason-Code], | |
| LAG([Calling_Station_ID],1) OVER( PARTITION BY [User_Name] ORDER BY [User_Name]) client FROM [NPSODBC].[dbo].[accounting_data] WHERE [Reason-Code] != 0 | |
| ) a |
This file contains hidden or 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/local/bin/pwsh | |
| if ("abc def" -match "abcx*") { | |
| Write-Host "Found a match! 1" | |
| } | |
| if ("abc def" -match "axc*") { | |
| Write-Host "Found a match! 2" | |
| } |
This file contains hidden or 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 | |
| import csv | |
| infile = open("input-file.csv") | |
| inreader = csv.reader(infile) | |
| for row in inreader: | |
| print(f"first field: {row[0]} second field: {row[1]} third field: {row[2]}") |
This file contains hidden or 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
| #!/bin/bash | |
| # Usage: | |
| # $ notes.sh something you want to jot down (appends that text to the file) | |
| # $ xclip -o | notes.sh (appends your clipboard to the file) | |
| # $ notes.sh | |
| readonly NOTES_DIRECTORY="${HOME}/Documents/Obsidian/Notes/Daily" | |
| NOTE_DATE=`date +'%Y-%m-%d'` |
This file contains hidden or 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
| mib: FORTINET-FORTIGATE-MIB | |
| modules: | |
| mempools: | |
| data: | |
| - | |
| total: FORTINET-FORTIGATE-MIB::fgSysMemCapacity | |
| percent_used: FORTINET-FORTIGATE-MIB::fgSysMemUsage | |
| precision: 1024 | |
| descr: 'Main Memory' | |
| os: |
This file contains hidden or 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
| <?php | |
| /* | |
| * Fortigate | |
| * | |
| * Props to @laf | |
| */ | |
| /* fgWfHTTPBlocked */ | |
| if (str_contains($sensor['sensor_oid'], '.1.3.6.1.4.1.12356.101.10.1.2.1.1.1')) |
This file contains hidden or 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
| #!/bin/bash | |
| # Store multiple lines of text in a variable. | |
| # More info: https://linuxhint.com/bash-define-multiline-string-variable/ | |
| MYLINES=$(cat << EOF | |
| line 1 | |
| line 2 | |
| line3 (but really line 4) | |
| EOF |
This file contains hidden or 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
| from queue import Queue | |
| from threading import Thread | |
| from time import sleep | |
| from rich.live import Live | |
| from rich.panel import Panel | |
| from rich.progress import Progress, SpinnerColumn, BarColumn, TextColumn | |
| from rich.table import Table as rcTable | |
| from rich.console import Console | |
| from rich.spinner import Spinner, SPINNERS | |
| from rich.status import Status |