Skip to content

Instantly share code, notes, and snippets.

@d-demirci
d-demirci / setupyara.sh
Created April 8, 2022 12:35 — forked from kirantambe/setupyara.sh
Install yara and yara-python with androguard, dotnet and cuckoo modules
brew install jansson # OR apt-get install libjansson-dev for debian based linux distros
git clone https://github.com/VirusTotal/yara.git
cd yara/libyara/modules/
curl -O https://raw.githubusercontent.com/Anlyz/androguard-yara/master/androguard.c
sed -i -e 's/MODULE(cuckoo)/MODULE(cuckoo)'$'\\\nMODULE(androguard)/g' module_list
cd ..
sed -i -e 's~MODULES += modules\/cuckoo.c~MODULES += modules\/cuckoo.c'$'\\\nMODULES += modules/androguard.c~g' Makefile.am
cd ..
./bootstrap.sh
./configure --enable-cuckoo --enable-dotnet --enable-magic
sudo apt update
sudo apt install build-essential zlib1g-dev libssl-dev -y
sudo mkdir /var/lib/sshd
sudo chmod -R 700 /var/lib/sshd/
sudo chown -R root:sys /var/lib/sshd/
wget -c https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz
tar -xzf openssh-8.4p1.tar.gz
cd openssh-8.4p1/
sudo apt install libpam0g-dev libselinux1-dev -y
sudo apt install libkrb5-dev -y
@d-demirci
d-demirci / windows_kvm_install.sh
Created January 14, 2021 23:53
Install Windows Serer on kvm with drivers
sudo virt-install \
--name=WindowsServer2019 \
--ram=4096 \
--cpu host --hvm \
--vcpus=2 \
--os-type=windows \
--os-variant=win8.1 \
--disk /var/lib/libvirt/images/vms-win10,size=64,bus=virtio \
--disk /var/lib/libvirt/boot/winsrv2k16.iso,device=cdrom,bus=ide \
--disk /var/lib/libvirt/boot/virtio-win.iso,device=cdrom,bus=ide \
name: lms_settings
version: 0.1.0
patches:
lms-env-features: |
"COURSES_ARE_BROWSABLE": false,
"ENABLE_SYSADMIN_DASHBOARD": true,
"DISABLE_LOGIN_BUTTON": true,
"ALLOW_PUBLIC_ACCOUNT_CREATION": false,
"ENABLE_DASHBOARD_SEARCH": false
@d-demirci
d-demirci / middleware.py
Created September 17, 2020 16:48
tutor middleware sso openedx
""" sso openedx test for replay attack"""
"""
Cache-backed ``AuthenticationMiddleware``
-----------------------------------------
``CacheBackedAuthenticationMiddleware`` is an
``django.contrib.auth.middleware.AuthenticationMiddleware`` replacement to
avoid querying the database for a ``User`` instance in each request.
Whilst the built-in ``AuthenticationMiddleware`` mechanism will only obtain the
@d-demirci
d-demirci / sessiondb.yml
Last active February 20, 2021 20:05
session cached db tutor
name: sessiondb
version: 0.1.0
patches:
common-env-features: |
"ALLOW_PUBLIC_ACCOUNT_CREATION": false
openedx-lms-common-settings: |
SESSION_ENGINE= "django.contrib.sessions.backends.db"
openedx-cms-common-settings: |
SESSION_ENGINE= "django.contrib.sessions.backends.db"
@d-demirci
d-demirci / keycloak.yml
Created September 15, 2020 18:29
keycloak tutor openedx plugin
name: keycloak
version: 0.1.0
patches:
common-env-features: |
"ENABLE_THIRD_PARTY_AUTH": true
openedx-lms-common-settings: |
SOCIAL_AUTH_KEYCLOAK_KEY = 'educasual'
SOCIAL_AUTH_KEYCLOAK_SECRET = '7c81d36a-bec9-4833-931c-64baab674283'
SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjyq0SjRVvMaoHDeB4AcyBmWNNLe36ibopb/8cgXwPIPtphX50MepMK5Xmne1euS6I8ZWPGJl3DNtK215AMUKoy87BSJX5o26RQx8d0M+WTvnw6EVLaskeJSiXu4WkYka2Ou+cc6mkyMMtDnkFybbjFFFdMOkDPSyCMEfakHH2b/es+6KBkIC+yqmigDy/S26rsVX5A7kFUP7QUGBPJqwOVQjyd9JaebQlxwN300NlWme2wZrypXOxWraPmpMsWlZVEtniqO+gtOT+ko41VQospwrsJSfSX05ch25WNIsDhOPNhfYOpdFDviHEiXMjtMm+XTLr0qfzVDdYEyJnmG7XwIDAQAB'
SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL = 'http://keycloak.nubidus.com/auth/realms/openedx/protocol/openid-connect/auth'
@d-demirci
d-demirci / custom_cert.yml
Created September 10, 2020 20:41
tutor custom certificate
name: customcert
version: 0.1.0
patches:
common-env-features: |
"CUSTOM_CERTIFICATE_TEMPLATES_ENABLED": true,
"ORGANIZATIONS_APP": true
# tutor plugins install custom_cert.yml
# tutor plugins enable customcert
@d-demirci
d-demirci / python-po-translator.py
Created May 28, 2020 10:16
translate po file using google translator with python
#!/usr/env/bin python
from googletrans import Translator
import polib
translator = Translator(service_urls=[
'translate.google.com',
'translate.google.co.kr',
])
#source file
@d-demirci
d-demirci / clearable_file_input.html
Created May 26, 2020 07:56
clearable_file_input.html django/forms/widgets/ file upload bootstrap css
<!-- https://stackoverflow.com/questions/44675550/django-widget-override-template -->
{% load i18n %}{% if widget.is_initial %}{{ widget.initial_text }}: <a href="{{ widget.value.url }}">{{ widget.value }}</a>{% if not widget.required %}
<input type="checkbox" name="{{ widget.checkbox_name }}" id="{{ widget.checkbox_id }}">
<label for="{{ widget.checkbox_id }}">{{ widget.clear_checkbox_label }}</label>{% endif %}<br>
{{ widget.input_text }}:{% endif %}
<label class="btn btn-primary">{% trans 'Upload' %}<input type="{{ widget.type }}" name="{{ widget.name }}" hidden {% include "django/forms/widgets/attrs.html" %}> </label>