docker build -t name .
docker run -p 8080:80 name
docker run -d -p 8080:80 name
docker exec -it [id] bash
docker ps
docker stop <id>
docker ps -a
aws ec2 describe-instances
aws ec2 describe-instances --instance-ids <instance1> <instance2>
aws ec2 describe-instances --filters Name=<instance_name>
aws ec2 start-instances --instance-ids <instance1> <instance2>
aws ec2 stop-instances --instance-ids <instance1> <instance2>
aws ec2 terminate-instances --instance-ids
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from requests.adapters import HTTPAdapter | |
from urllib3.util.retry import Retry | |
from random_useragent import random_useragent | |
class RequestsHelper(object): | |
"""HTTP Request helper""" | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-EventLog -LogName Security -after (Get-date -hour 0 -minute 0 -second 0) | Where-Object { (4624, 4778) -contains $_.EventID -and $_.Message -match 'logon type:\s+(10)\s' } | % { | |
(new-object -Type PSObject -Property @{ | |
TimeGenerated = $_.TimeGenerated | |
ClientIP = $_.Message -replace '(?smi).*Source Network Address:\s+([^\s]+)\s+.*', '$1' | |
UserName = $_.Message -replace '(?smi).*Account Name:\s+([^\s]+)\s+.*', '$1' | |
UserDomain = $_.Message -replace '(?smi).*Account Domain:\s+([^\s]+)\s+.*', '$1' | |
LogonType = $_.Message -replace '(?smi).*Logon Type:\s+([^\s]+)\s+.*', '$1' | |
}) | |
} | Sort-Object TimeGenerated -Descending | Select-Object TimeGenerated, ClientIP ` | |
, @{N = 'Username'; E = { '{0}\{1}' -f $_.UserDomain, $_.UserName } } ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** | |
** derleme: | |
** gcc -O3 -DMAX_THREAD=8 tcnouretici.c -lpthread | |
** | |
** i7-4770k 8 thread | |
** ./a.out > /dev/null 0.02s user 0.01s system 473% cpu 0.008 total | |
** ./a.out > /dev/null 0.03s user 0.00s system 382% cpu 0.008 total | |
** ./a.out > /dev/null 0.03s user 0.00s system 484% cpu 0.007 total | |
** ./a.out > /dev/null 0.03s user 0.00s system 377% cpu 0.008 total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements | |
# - pip install zeep | |
# | |
# Mertcan GÖKGÖZ - 2019 | |
# PrismaCSI | |
# | |
import re | |
import zeep | |
from zeep.cache import SqliteCache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SetTimeZoneView(LoginRequiredMixin, View): | |
def post(self, *args, **kwargs): | |
Users.objects.filter(id=self.request.user.id).update( | |
timezone=self.request.POST["timezone"] | |
) | |
messages.success(self.request, 'Timezone was successfully changed') | |
return HttpResponseRedirect(self.request.META.get("HTTP_REFERER")) | |
class SetLanguageView(LoginRequiredMixin, View): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02122129423 | |
02122651575 | |
02122867237 | |
02124016985 | |
02124666724 | |
02124820337 | |
02125158552 | |
02125990803 | |
02125990804 | |
02125990806 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.views import exception_handler | |
from rest_framework.response import Response | |
def JsonAPICustomExeptionHandler(exc, context): | |
response = exception_handler(exc, context) | |
if response is not None: | |
return Response({ | |
"errors": { | |
"status_code": response.status_code, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@register.filter | |
def clear(value, arg): | |
value = str(value) | |
for i in arg.split(","): | |
value = value.replace(i, " ") | |
return value | |
@register.filter | |
def is_list(value): |