Skip to content

Instantly share code, notes, and snippets.

View wisedier's full-sized avatar
🎯
Focusing

Junsang Cheon wisedier

🎯
Focusing
View GitHub Profile
@wisedier
wisedier / README.md
Last active September 4, 2021 13:20
Convert MBR to GPT in order to enable UEFI and Secure Boot
  1. Open Powershell with administrator privilege.
  2. Type Get-Disk | ft -auto and find the disk number where the OS is installed.
  3. Type mbr2gpt.exe /validate /disk:[number] /allowFullOS
    If success is in the prompt output, conversion is possible.
    If there isn't, you shoud check https://docs.microsoft.com/ko-kr/windows/deployment/mbr-to-gpt to satisfy some condition to do it.
  4. Type mbr2gpt.exe /convert /disk:[number] /allowFullOS
    If there is a line starts with Before and ends with UEFI mode, you are done.
  5. Restart the PC and enter to CMOS.
  6. Change BIOS to UEFI mode and enable Secure Boot.
@wisedier
wisedier / zoom.tsx
Created February 5, 2020 17:48
d3 zoom
interface GraphNode {
id: string | number;
type: DrawerTypes;
scale: number;
hover: boolean;
active: boolean;
neighbors: (D3GraphNode | GraphEdge)[];
}
interface D3GraphNode extends d3.SimulationNodeDatum, GraphNode {
@wisedier
wisedier / models.py
Created November 20, 2019 06:43
SQLAlachemy eager loading in CTE recursive query for a self-relational model which is a declarative model
class Network(Base, IdMixin, TimestampMixin):
ip_address = sa.Column(IPAddressType, nullable=False)
netmask = sa.Column(IPAddressType, nullable=False)
name = sa.Column(sa.String(64), nullable=False, default=lambda: str(uuid.uuid4()), unique=True)
class Host(Base, IdMixin, TimestampMixin):
name = sa.Column(sa.String(64), nullable=False)
addr = sa.Column(sa.String(256), nullable=False)
is_compromised = sa.Column(sa.Boolean, nullable=False, default=False)
@wisedier
wisedier / README.md
Last active November 3, 2019 16:15
Installing OpenSCADA with latest version of dependencies

OpenSCADA Installation

OpenSCADA is platform which supports high fidelity emulation of IEC 6111-3 compliant PLCs and SCADA protocols. You can check details at OpenSCADA documentation.

Environment

  • Ubuntu 18.04.3 LTS (x86_64)

Install required packages

@wisedier
wisedier / README.md
Last active August 18, 2023 14:56
Create headless Ubuntu 18.04 virtual machine with Oracle Virtualbox only using command line in offline environment
@wisedier
wisedier / aliases.sh
Created November 20, 2017 01:53
shell aliases
alias pip-upgrade-all="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
alias p="python"
alias l="ls"
@wisedier
wisedier / decorator.py
Last active July 13, 2017 04:31
Access private members each other using decorator as a class instance method
# -*- coding:utf-8 -*-
class Foo(object):
def __init__(self):
self.__private_foo = 'private foo'
def decorator(self, option):
print 'decorator argument:', option
print self.__private_foo
@wisedier
wisedier / run_with_nsjail.sh
Last active May 18, 2017 05:44
nsjail command
#!/bin/sh
# alarm() doesn't work in nsjail. So you need to add -t option
nsjail -d --log /var/log/nsjail/contact -Ml --port 10001 -u 65534:10001 -g 65534:10001 \
--disable_clone_newnet -R /opt/challenges/contact -E PATH=/usr/local/bin:/usr/bin:/bin \
-E HOME=/opt/challenges/contact -R /bin/ -R /lib/ -R /lib32/ -R /lib64/ -R /usr/ -R /sbin/ \
-T /dev -R /dev/urandom -R /etc/ssl/certs -R /etc/resolv.conf -R /run/resolvconf/ -T /tmp/ \
-t 300 -- /opt/challenges/contact/contact
@wisedier
wisedier / utils.py
Created August 26, 2016 07:21
Check json request in Flask
# -*- coding:utf-8 -*-
from functools import wraps
from flask import abort, request
def is_json_request():
"""
Returns True if the request is json request else False.
For example::