Skip to content

Instantly share code, notes, and snippets.

View cKurultayKalkan's full-sized avatar
🧐

Çağdaş Kurultay Kalkan cKurultayKalkan

🧐
View GitHub Profile
@cKurultayKalkan
cKurultayKalkan / DefaultUserPolicy.json
Created August 21, 2022 01:22
AWS MFA Forcement Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:GetAccountSummary",
"iam:ListVirtualMFADevices"
@cKurultayKalkan
cKurultayKalkan / kinesis.ts
Created March 7, 2022 23:47
Kinesis aws-sdk-v3
import { KinesisClient, PutRecordCommand, PutRecordCommandInput, KinesisClientConfig } from "@aws-sdk/client-kinesis"; // ES Modules import
interface KinesisStreamInterface {
data: string,
config: KinesisClientConfig,
client: KinesisClient,
channelId: string
}
@cKurultayKalkan
cKurultayKalkan / gist:d7e25b4011a364e285c22aa984ed0ab7
Created November 19, 2021 22:11 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@cKurultayKalkan
cKurultayKalkan / common_h264_codec_strings_used_in_youtube__no_parsing.js
Created August 3, 2021 22:53
H.264 Codec String Parser (video, profile, level) - August 2017
//"avcoti" hexadecimal representation of the following three bytes in the (subset) sequence parameter set Network Abstraction Layer (NAL) unit specified in AVC: 1.profile_idc, 2.the byte containing the constraint_set flags (currently constraint_set0_flag through constraint_set5_flag, and the reserved_zero_2bits), 3.level_idc.
AVC1_CODEC_MAP = {
,"avc1.66.30": {profile:"Baseline", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
"avc1.42001e": {profile:"Baseline", level:3.0, max_bit_rate:10000}
,"avc1.42001f": {profile:"Baseline", level:3.1, max_bit_rate:14000}
//other variations
,"avc1.77.30": {profile:"Main", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
,"avc1.4d001e": {profile:"Main", level:3.0, max_bit_rate:10000}
,"avc1.4d001f": {profile:"Main", level:3.1, max_bit_rate:14000}
git config --global --add alias.permission-reset '!git diff -p -R --no-ext-diff --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply'
@cKurultayKalkan
cKurultayKalkan / emulator-install-using-avdmanager.md
Created January 12, 2021 00:06 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@cKurultayKalkan
cKurultayKalkan / django tips
Created September 19, 2020 19:58
Django Helper
# Initial Value For Foreign Keys
class MyModelAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if db_field.name == 'author':
kwargs['initial'] = request.user.id
return super(MyModelAdmin, self).formfield_for_foreignkey(
db_field, request, **kwargs
)
folder=artikel
host_server=*.*.*.*
ssh_user=ubuntu
ssh_port=1003
cd $folder
ssh -p $ssh_port $ssh_user@$host_server "mkdir /home/ubuntu/apps/customers/$folder"
tar --exclude static --exclude venv --exclude node_modules -zcvf $folder.tar.gz *
scp -P $ssh_port $folder.tar.gz $ssh_user@$host_server:/home/ubuntu/apps/customers/$folder
ssh -p $ssh_port $ssh_user@$host_server "cd /home/ubuntu/apps/customers/$folder && tar -xvf $folder.tar.gz"
find . -name .git -type d -execdir git pull -v \;
find . -maxdepth 2 -name package.json -type f -execdir npm install \;
find . -maxdepth 2 -name package.json -type f -execdir npm audit fix \;
pm2 restart all
cd $DIRNAME
ng build
pkill chromium
""" workon cv
pip install requests"""
# import the necessary packages
from imutils import paths
import argparse
import requests
import cv2
import os