Skip to content

Instantly share code, notes, and snippets.

View dyipon's full-sized avatar

dy dyipon

  • iPon Computer
  • Eger, Hungary
View GitHub Profile
Add-Type @'
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace PInvoke.Win32 {
public static class UserInput {
[DllImport("user32.dll", SetLastError=false)]
private static extern bool GetLastInputInfo(ref LASTINPUTINFO plii);
[StructLayout(LayoutKind.Sequential)]
private struct LASTINPUTINFO {
backup:
curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
"type": "visualization"
}
' \
-o kibana.visualization.ndjson
restore:
select stage,state,begin_time as start_time,end_time,round(data/1000/1000) as MB from performance_schema.clone_progress;
or more detailed:
select STAGE, STATE, CAST(BEGIN_TIME AS TIME) as "START TIME",
CASE WHEN END_TIME IS NULL THEN
LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ')
ELSE
LPAD(sys.format_time(POWER(10,12) * (UNIX_TIMESTAMP(END_TIME) - UNIX_TIMESTAMP(BEGIN_TIME))), 10, ' ')
END as DURATION,
Flask
gunicorn
selenium
chromedriver-binary==85.0.4183.87.0
pytz

master:

curl -sfL https://get.k3s.io | sh -
cat /var/lib/rancher/k3s/server/node-token

nodes:

key command
alt-# commenting ( "Alt-X": "lua:comment.comment" )
ctrl-u macro recording stop/Start
ctrl-j re-play recorded macro
f8/ctrl-k del line
alt-up/down move line/selection up/down
ctrl-z/y undo/redo
ctrl-c/v copy/paste
ctrl-r toggle line numbers
whois -h whois.radb.net -i origin -T route $(whois -h whois.radb.net 1.2.3.4 | grep origin: | cut -d ' ' -f 6 | head -1) | grep -w "route:"
 | awk '{print $NF}' |sort -n
docker run --rm -i -t httpd:alpine htpasswd -nb foo bar|openssl base64
curl -sSL -X GET 'http://es-for-logging-master:9200/filebeat*/_search?pretty' -H 'Content-Type: application/json' -d '{
    "query": {
        "query_string": {
            "query": "kubernetes.labels.app:helloworld"
        }
    },
    "size": 1000,
    "from": 0,
 "sort": [
kubectl get pods --all-namespaces -o=jsonpath="{range .items[*]}{'\n'}{range .spec.containers[*]}{.image}{'\n'}{end}{end}" | sort | uniq