Skip to content

Instantly share code, notes, and snippets.

View ademkocamaz's full-sized avatar

Adem KOCAMAZ ademkocamaz

View GitHub Profile
@ademkocamaz
ademkocamaz / customize-save-in-django-admin-inline-form.org
Created September 28, 2023 04:47 — forked from shymonk/customize-save-in-django-admin-inline-form.org
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@ademkocamaz
ademkocamaz / admin.py
Created September 25, 2023 22:15 — forked from lc-thomas/admin.py
Django custom admin site with list_display, tabular inline data, custom templates and custom view
from django.contrib import admin
from django.contrib.admin.models import LogEntry
from django.db.models import ManyToOneRel, ForeignKey, OneToOneField
from django.apps import apps
from django.contrib.auth.models import Group, User
from django.contrib.auth.admin import GroupAdmin, UserAdmin
from django.conf.urls import url
# admin custom views
from . import admin_views
@ademkocamaz
ademkocamaz / scorched_earth.sh
Created September 25, 2023 18:08 — forked from adamghill/scorched_earth.sh
Start from scratch for database migrations in Django
#!/bin/sh
set -e
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Database name argument is required"
@ademkocamaz
ademkocamaz / simplexml-curl-feed-fetch.php
Created August 28, 2023 15:50 — forked from deepak-rajpal/simplexml-curl-feed-fetch.php
Fetch XML Feeds using cURL and SimpleXML - Best and Tested
<?php
/* Fetch XML feeds using PHP SimpleXML and cURL */
/* Step 1) Parse xml url in curl and assign all data into a variable
Step 2) Pass Xml data into SimpleXML and access elements using returned object */
/* =================The SimpleXML =========================
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators.
This extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default. The SimpleXML extension requires PHP 5.
<?php
// Initilise cURL
$ch = curl_init();
// Set the cURL Options
$optArray = array(
CURLOPT_URL => 'https://example.com/api/getInfo/',
CURLOPT_RETURNTRANSFER => true
);
@ademkocamaz
ademkocamaz / visualstudio2019Key.txt
Created August 20, 2023 14:08
Visual Studio 2019 Product Key
Visual Studio 2019 Product Key
[Please Star this gist]
**Follow Me On Instagram -->> https://www.instagram.com/ahtazaz_mughal/**
Whatsapp +923451525359
Visual Studio 2019 Enterprise
@ademkocamaz
ademkocamaz / hl7mlp_receiver.js
Created July 17, 2023 21:16 — forked from palefailmel/hl7mlp_receiver.js
A simple node.js HL7 MLP server. Saves messages in files in a local folder, and generates ACK to send back to application.
/*
Author: Michael Stevenson
Date : 2014/09/03
Desc : Receive HL7 message from an MLP tcp interface on a specific port and ip.
Saves message to folder on PC. Constructs and sends ACK back to interface
*/
var net = require('net');
var fs = require('fs');
bin,banka_kodu,banka_adi,type,sub_type,virtual,prepaid
413226,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
444676,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,CLASSIC
444677,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,GOLD
444678,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
453955,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
453956,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, GOLD
454671,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454672,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454673,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, BUSINESS
@ademkocamaz
ademkocamaz / 01-aes-bruteforce.py
Created April 22, 2023 20:35 — forked from diyinfosec/01-aes-bruteforce.py
Brute-force AES-256 keys from memory dump.
from timeit import default_timer as timer
from binascii import b2a_hex
#- Config variables
filename="memory.dmp"
aes_key_size=32
#- Variables related to file processing
file_offset=0;
total_keys_found = 0;
@ademkocamaz
ademkocamaz / install-xrdp-ubuntu-18.04.md
Created April 10, 2023 13:33 — forked from hehuan2112/install-xrdp-ubuntu-18.04.md
Install Remote Desktop (xRDP) for Ubuntu Server 18.04

Install Remote Desktop (xRDP) for Ubuntu Server 18.04

Step 1 – Install xRDP:

sudo apt update
sudo apt install xrdp

Step 2 – Install XFCE4

sudo apt install xfce4