Skip to content

Instantly share code, notes, and snippets.

💭
Working #golang @ ICS Defense

Erhan Yakut yakuter

💭
Working #golang @ ICS Defense
View GitHub Profile
@yakuter
yakuter / CryptoJS.js
Last active Jun 12, 2020
CryptoJS AES Example
View CryptoJS.js
<!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>
View PBKDF2-js-golang.go
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
@yakuter
yakuter / commands.md
Last active May 26, 2020
Usefull Postgresql Commands
View commands.md

Usefull Postgresql Commands

Show databases \l

Choose database \c passwall

List tables \dt

View chrome.js
document.addEventListener('DOMContentLoaded', function() {
var copyTextareaBtn = document.querySelector('#kopyala');
copyTextareaBtn.addEventListener('click', function(event) {
var copyTextarea = document.querySelector('#veri');
copyTextarea.focus();
copyTextarea.select();
try {
View fluentd.md

sudo launchctl load /Library/LaunchDaemons/td-agent.plist sudo launchctl unload /Library/LaunchDaemons/td-agent.plist

@yakuter
yakuter / useful-docker-commands.go
Last active Apr 21, 2020
Useful Docker Commands
View useful-docker-commands.go
//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
@yakuter
yakuter / nats.php
Created May 5, 2019
PHP and NATS.io Example
View nats.php
<?php
require_once 'vendor/autoload.php';
// Yeni bağlantı nesnesi oluşturma ve bağlanma
$client = new \Nats\Connection();
$client->connect();
// Subscriber
$callback = function($payload)
@yakuter
yakuter / channel.go
Created Apr 18, 2019
Go Channel Oluşturma Örneği
View channel.go
ilkKanal := make(chan string)
ilkKanal <- "merhaba" // Gönderme
degisken := <- ilkKanal // Alma
@yakuter
yakuter / main.go
Created Apr 18, 2019
İsimsiz Go Routine Örneği
View main.go
func main() {
go func() {
fmt.Println("Merhaba isimsiz dünya")
}()
}
@yakuter
yakuter / main.go
Created Apr 18, 2019
Go'da Worker Pool Örneği
View main.go
package main
import "fmt"
import "time"
// Birden fazla eş zamanlı görevi vereceğimiz işçilerimizi
// burada tanımlıyoruz. Bu işçiler jobs kanaldaki işleri alıp,
// sonuçlarını işe karşılık gelen results kanalına iletmekteler.
// Yapılan işi tanımlamak için 1 saniyelik bekleme koyulmuştur.
func worker(id int, jobs <-chan int, results chan<- int) {
You can’t perform that action at this time.