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
# TOPICS | |
kafka-topics --bootstrap-server localhost:9092 --list | |
kafka-topics --bootstrap-server localhost:9092 --topic topic_name --create --partitions 3 --replication-factor 2 | |
kafka-topics --bootstrap-server localhost:9092 --topic topic_name --describe | |
kafka-topics --bootstrap-server localhost:9092 --topic topic_name --delete |
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
# -*- coding: utf-8 -*- | |
__author__ = "mertsalik" | |
__copyright__ = "Copyright 2021" | |
__credits__ = ["mertsalik", ""] | |
__license__ = "Private" | |
__email__ = "" | |
import os | |
import pathlib |
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 objc | |
objc.loadBundle('CoreWLAN', bundle_path = '/System/Library/Frameworks/CoreWLAN.framework', | |
module_globals = globals()) | |
iface = CWInterface.interface() | |
# Scan all available networks | |
iface.scanForNetworksWithName_includeHidden_error_(None, True, None) | |
# Scan with specific name | |
networks, error = iface.scanForNetworksWithName_error_('FooNetworkName', None) |
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 | |
class Abuzer(object): | |
def __init__(self, base_url, login_path): | |
self.base_url = base_url | |
self._login_path = login_path | |
self._session = requests.session() |
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
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d |
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 weasyprint import HTML | |
from io import BytesIO | |
def convert_html_to_pdf(html_string): | |
""" | |
:param html_string: rendered invoice html | |
:return: bytes array | |
""" | |
with BytesIO() as byte_io: | |
HTML(string=html_string).write_pdf(byte_io) |
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
See: https://stackoverflow.com/a/246779/930899 | |
I may have found a way to do it. | |
Create a file .pythonrc | |
# ~/.pythonrc | |
# enable syntax completion | |
try: | |
import readline |
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
# Ubuntu 16.04.2 LTS | |
# rcn-ee.net console Ubuntu Image 2017-07-14 | |
# Beagle bone black | |
mkdir tmp | |
cd tmp | |
git clone https://github.com/lwfinger/rtl8188eu.git | |
cd rtl8188eu | |
make all | |
sudo make install |
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
# US East speedtest.newark.linode.com 100MB-newark.bin | |
# US South speedtest.atlanta.linode.com 100MB-atlanta.bin | |
# US Central speedtest.dallas.linode.com 100MB-dallas.bin | |
# US West speedtest.fremont.linode.com 100MB-fremont.bin | |
# Frankfurt speedtest.frankfurt.linode.com 100MB-frankfurt.bin | |
# London speedtest.london.linode.com 100MB-london.bin | |
# Singapore speedtest.singapore.linode.com 100MB-singapore.bin | |
# Tokyo 2, Japan speedtest.tokyo2.linode.com 100MB-tokyo2.bin | |
echo "US EAST" |
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
#!/bin/bash | |
#set -e | |
# install-wifi - 28/05/2017 - by MrEngman. | |
UPDATE_SELF=${UPDATE_SELF:-1} | |
UPDATE_URI="http://www.fars-robotics.net/install-wifi" | |
ROOT_PATH=${ROOT_PATH:-"/"} | |
WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"} |
NewerOlder