Skip to content

Instantly share code, notes, and snippets.

Avatar
💤
living the data dream

Raki mdrakiburrahman

💤
living the data dream
View GitHub Profile
@IAmStoxe
IAmStoxe / Delete-PodsByRegex.ps1
Created Jun 26, 2020
Delete all kubernetes pods by regex pattern with PowerShell
View Delete-PodsByRegex.ps1
$NS="NameSpace"; $Pattern="amass"; & kubectl get pods -n $NS | % {"$_" -Split " "} | Select-String -Pattern $Pattern | %{ & kubectl delete -n $NS pod $_ }
@veggiemonk
veggiemonk / CKAD.md
Last active Apr 22, 2022
CKAD exam preparation
View CKAD.md
View az_metrics.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 7 columns, instead of 6. in line 5.
,Metric,Metric Display Name,Unit,Aggregation Type,Description,Dimensions
1, azure.analysisservices_servers.qpu_metric,QPU,Count,Average," Microsoft.AnalysisServices/servers: QPU. Range 0-100 for S1, 0-200 for S2 and 0-400 for S4",ServerResourceType
2, azure.analysisservices_servers.memory_metric,Memory,Bytes,Average," Microsoft.AnalysisServices/servers: Memory. Range 0-25 GB for S1, 0-50 GB for S2 and 0-100 GB for S4",ServerResourceType
3, azure.analysisservices_servers.total_connection_requests,Total Connection Requests,Count,Average, Microsoft.AnalysisServices/servers: Total connection requests. These are arrivals.,ServerResourceType
4, azure.analysisservices_servers.successfull_connections_per_sec,Successful Connections Per Sec,CountPerSecond,Average, Microsoft.AnalysisServices/servers: Rate of successful connection completions.,ServerResourceType
5, azure.analysisservices_servers.total_connection_failures,Total Connection Failures,Count,Average, Microsoft.AnalysisServices/servers: Total failed connection
View GitHub spoiler markdown.md

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View regex.txt
Perl and PHP Regular Expressions
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa.
//All major credit cards regex
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/'