Skip to content

Instantly share code, notes, and snippets.

View pasali's full-sized avatar
🎯
Focusing

Mehmet Başal pasali

🎯
Focusing
View GitHub Profile
@pasali
pasali / key_change.sh
Last active May 21, 2020 05:50
AWS SSM update encryption key of secret
#!/usr/bin/env bash
keys=$(aws ssm get-parameters-by-path --path "/prod" --with-decryption | jq --raw-output '.Parameters[] | {name: .Name, value: .Value} | @base64')
for k in $keys; do
key="$(echo "$k" | base64 --decode)"
name=$(echo "$key" | jq --raw-output '.name')
value=$(echo "$key" | jq --raw-output '.value')
echo $name
aws ssm put-parameter --overwrite --name ${name} --type "SecureString" --value "${value}" --key-id "alias/custom/ssm"
done
@pasali
pasali / appscript.go
Created February 28, 2019 11:39
Appscript token generator
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
#!/usr/bin/env bash
curl -o $HOME/Downloads/maxdefaultimage.jpg http://img01.alkislarlayasiyorum.com/images/all_content_thumbnail/109/109043-8950.jpg
echo 'alias ls="open $HOME/Downloads/maxdefaultimage.jpg"' >> $HOME/.bash_profile
source $HOME/.bash_profile
@pasali
pasali / SQL-Insert-Statements.sql.groovy
Last active October 12, 2021 08:28
SQL Bulk insert export script for DataGrip
SEP = ", "
QUOTE = "\'"
NEWLINE = System.getProperty("line.separator")
KEYWORDS_LOWERCASE = com.intellij.database.util.DbSqlUtil.areKeywordsLowerCase(PROJECT)
KW_INSERT_INTO = KEYWORDS_LOWERCASE ? "insert into " : "INSERT INTO "
KW_VALUES = KEYWORDS_LOWERCASE ? "values" : "VALUES"
KW_NULL = KEYWORDS_LOWERCASE ? "null" : "NULL"
OUT.append(KW_INSERT_INTO)

Keybase proof

I hereby claim:

  • I am pasali on github.
  • I am pasali (https://keybase.io/pasali) on keybase.
  • I have a public key whose fingerprint is 81ED 8EA6 4394 BA7F D46C EEDA 2E25 8FF8 D0E8 1C5B

To claim this, I am signing this object:

module carp(a, b, y);
parameter N = 4;
input [N - 1:0] a;
input [N - 1:0] b;
output [2*N - 1:0] y;
wire [N - 1:0] m [0:N - 1];
wire [N - 1:0] p [0:N - 1];
genvar i;
#!/usr/bin/bash
DOSYA=$1
OLDIFS=$IFS
IFS=,
[ ! -f $DOSYA ] && { echo "$DOSYA bulunamadi"; exit 99; }
toplam=0
sayac=0
while read ad soyad no not
do
import java.math.BigInteger;
import java.util.Random;
public class MillerRabin {
public static final BigInteger ZERO = BigInteger.ZERO;
public static final BigInteger ONE = BigInteger.ONE;
public static final BigInteger TWO = BigInteger.valueOf(2);
import java.math.BigInteger;
import java.util.Random;
public class MillerRabin {
public static final BigInteger ZERO = BigInteger.ZERO;
public static final BigInteger ONE = BigInteger.ONE;
public static final BigInteger TWO = BigInteger.valueOf(2);
public static final int[] aValues = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,
@pasali
pasali / src.go
Last active December 31, 2015 19:39
package main
import (
"fmt"
"os"
"os/exec"
"strings"
)
var tokens []string