Show databases
\l
Choose database
\c passwall
List tables
\dt
type Args interface { | |
// Get returns the nth argument, or else a blank string | |
Get(n int) string | |
// First returns the first argument, or else a blank string | |
First() string | |
// Tail returns the rest of the arguments (not the first one) | |
// or else an empty string slice | |
Tail() []string | |
// Len returns the length of the wrapped slice | |
Len() int |
// Source: https://ixday.github.io/post/golang-cancel-copy/ | |
import ( | |
"io" | |
"context" | |
) | |
// here is some syntaxic sugar inspired by the Tomas Senart's video, | |
// it allows me to inline the Reader interface | |
type readerFunc func(p []byte) (n int, err error) |
package main | |
import ( | |
"log" | |
"os" | |
) | |
func main() { | |
file, err := os.OpenFile("geekday.txt", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644) | |
if err != nil { |
// b2s converts byte slice to a string without memory allocation. | |
// See https://groups.google.com/forum/#!msg/Golang-Nuts/ENgbUzYvCuU/90yGx7GUAgAJ . | |
// | |
// Note it may break if string and/or slice header will change | |
// in the future go versions. | |
func b2s(b []byte) string { | |
/* #nosec G103 */ | |
return *(*string)(unsafe.Pointer(&b)) | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/core-min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/sha256.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/pbkdf2.js"></script> |
import CryptoJS from 'crypto-js' | |
export default { | |
pbkdf2Encrypt(value) { | |
var salt = 'asdfghjkl' | |
const cipher = CryptoJS.PBKDF2(value, salt, { | |
keySize: 256 / 8, | |
iterations: 10000, | |
hasher: CryptoJS.algo.SHA256 |
document.addEventListener('DOMContentLoaded', function() { | |
var copyTextareaBtn = document.querySelector('#kopyala'); | |
copyTextareaBtn.addEventListener('click', function(event) { | |
var copyTextarea = document.querySelector('#veri'); | |
copyTextarea.focus(); | |
copyTextarea.select(); | |
try { |
sudo launchctl load /Library/LaunchDaemons/td-agent.plist sudo launchctl unload /Library/LaunchDaemons/td-agent.plist
//GENERAL | |
docker ps | |
docker ps -a | |
docker image list | |
docker stop <containerid> | |
docker rm <containerid> | |
docker rmi <imageid> | |
// LIST AND DELETE ALL CONTAINERS | |
docker container ls |