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 / gist:c0d443295008a53b6005
Created February 14, 2015 06:11
when apt-get key error (W: GPG error:, W: There is no public key available for the following key IDs:)
. . .
Reading package lists... Done
W: GPG error: http://ftp.daum.net trusty-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40976EAF437D05B5
. . .
Reading package lists... Done
W: There is no public key available for the following key IDs:
3B4FE6ACC0B21F32
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32
@wisedier
wisedier / solution_for_broken_ko_lang
Last active August 29, 2015 14:16
Solution for broken Korean language in Ubuntu
$ sudo apt-get install language-pack-ko
$ sudo apt-get install language-pack-ko-base
$ sudo apt-get install localepurge
In the progress of installing of `localepurge`, setting script will be excuted. Then you must check `ko_KR.EUC-KR`.
If the script will not be excuted, type command `sudo dpkg-reconfigure localeconf`. Then you can do it.
After check it and push `Enter` button, window will be moved to option settings window. Then just push `Enter`.
Next,
$ sudo echo "ko_KR.EUC-KR EUC-KR" >> /var/lib/locales/supported.d/ko
$ sudo locale-gen --purge
$ sudo dpkg-reconfigure locales
@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::
@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 / 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 / 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 / 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 / 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 / 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)