Filter | Description | Example |
---|---|---|
allintext | Searches for occurrences of all the keywords given. | allintext:"keyword" |
intext | Searches for the occurrences of keywords all at once or one at a time. | intext:"keyword" |
inurl | Searches for a URL matching one of the keywords. | inurl:"keyword" |
allinurl | Searches for a URL matching all the keywords in the query. | allinurl:"keyword" |
intitle | Searches for occurrences of keywords in title all or one. | intitle:"keyword" |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func fib(ch chan string, number float64) { | |
x, y := 1.0, 1.0 |
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
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func fizzbuzz(num int) string { | |
switch { | |
case num%15 == 0: |
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
kubectl get nodes -o=custom-columns=NAME:.metadata.name,CAPACITY:.status.capacity.pods |
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
resource "azurerm_kubernetes_cluster_node_pool" "np" { | |
name = var.node_pool_name | |
kubernetes_cluster_id = azurerm_kubernetes_cluster.k8s.id | |
vm_size = var.np_size | |
node_count = var.np_count | |
enable_auto_scaling = var.np-enable_auto_scaling | |
max_count = var.np-enable_auto_scaling_max_count | |
min_count = var.np-enable_auto_scaling_min_count | |
zones = (var.np-availability_zones == "") ? [] : split(",", var.np-availability_zones) | |
max_pods = var.np-max_pods |
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
Simple GET example | |
$response = Invoke-RestMethod 'http://example.com/api/people' | |
# assuming the response was in this format { "items": [] } | |
# we can now extract the child people like this | |
$people = $response.items | |
GET with custom headers example | |
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" | |
$headers.Add("X-DATE", '9/29/2014') | |
$headers.Add("X-SIGNATURE", '234j123l4kl23j41l23k4j') | |
$headers.Add("X-API-KEY", 'testuser') |
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
Summary: | |
Run tcpdump on a pod and then see that information through Wireshark locally on my machine. | |
Topology | |
-------- | |
[laptop with wireshark] ------> [AKS Node] ------> [POD (tcpdump is here)]. | |
##1. Create the fifo on your local machine (where wireshark will run) | |
``` | |
mkfifo /tmp/remote-capture.fifo |
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
using System.Diagnostics; | |
string path = @"C:\Path\to\your\file.txt"; | |
ProcessStartInfo processInfo = new ProcessStartInfo(); | |
processInfo.FileName = @"powershell.exe"; | |
processInfo.Arguments = $@"-Command $ErrorActionPreference = 'Stop'; $VerbosePreference = 'Continue'; $ProgressPreference = 'SilentlyContinue'; | |
$fi = Get-ItemProperty -Path '{path}'; | |
$ShellApplication = New-Object -ComObject Shell.Application; | |
$ShellFolder = $ShellApplication.Namespace($fi.Directory.FullName); |
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
#!/bin/bash | |
namespaces=$(kubectl get ns --field-selector=status.phase==Terminating -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}') | |
if [ -z "$namespaces"] | |
then | |
echo "No namespaces to delete." | |
exit | |
else | |
for namespace in $namespaces |
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
$terminatingNamespaces = kubectl get ns --field-selector=status.phase==Terminating -o jsonpath="{range .items[*]}{.metadata.name}{'\n'}{end}" | |
foreach ($ns in $terminatingNamespaces) { | |
Write-Verbose '[FOUND]: Forcefully removing $ns' | |
$jsonObj = kubectl get namespace $ns -o json | ConvertFrom-Json | foreach-object { $_.spec.finalizers = @(); $_ } | | |
convertto-json | kubectl replace --raw /api/v1/namespaces/$namespace/finalize -f - | |
} |