# ~/.config/systemd/user/jupyter.service
[Unit]
Description=An interactive python notebook server
After=network.target
[Service]
ExecStart=/usr/bin/jupyter notebook\
--no-browser\
--port=8001\
This file contains hidden or 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 cx_Oracle | |
def main(): | |
# Variables | |
username: str = "HR" | |
password: str = "<YOUR_PASSWORD>" | |
host: str = "localhost" | |
service: str = "XE" | |
# Connection establishing |
This file contains hidden or 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
#!python3.7 | |
import random | |
import time | |
import PySide2 | |
from PySide2 import QtCore, QtWidgets | |
from PySide2.QtCore import Slot, Signal, QObject, QThreadPool, QRunnable | |
class MyEmitter(QObject): |
This file contains hidden or 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
qApp.setStyle(QStyleFactory.create("Fusion")) | |
darkPalette = QPalette() | |
darkColor = QColor(45, 45, 45) | |
disabledColor = QColor(127, 127, 127) | |
darkPalette.setColor(QPalette.Window, darkColor) | |
darkPalette.setColor(QPalette.WindowText, Qt.white) | |
darkPalette.setColor(QPalette.Base, QColor(40, 40, 40)) | |
darkPalette.setColor(QPalette.AlternateBase, darkColor) |
This file contains hidden or 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 socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind(('localhost', 1080)) | |
s.listen() | |
message = "Hello World" | |
message = bytes(message, "utf-8") | |
while True: |
This file contains hidden or 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 socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(('localhost', 1080)) | |
message = '' | |
while True: | |
msg = s.recv(1) | |
if len(msg) <= 0: | |
break |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
<h1 align="center">Redirecting in <span id="countdown">10</span> seconds</h1> | |
<script type="text/javascript"> | |
// Total seconds to wait | |
var seconds = 10; |
Command:
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"
URLs that can be created is from:
https://github.com/*
https://*.github.com
https://*.github.com/*
https://*.github.io
This file contains hidden or 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
var Base64 = (function () { | |
var ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
var Base64 = function () {}; | |
var _encode = function (value) { | |
if (typeof(value) !== 'number') { | |
throw 'Value is not number!'; |
This file contains hidden or 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
# Put this file in /etc/nginx/sites-available | |
# Then "ln -s /etc/nginx/sites-available/aria2-nginx.conf /etc/nginx/sites-enabled" | |
# Then "sudo service nginx restart" | |
server { | |
listen 80; | |
listen [::]:80; | |
root /var/www/aria2; # Put your aria2 web ui here, such as AriaNg | |
index index.html; | |
server_name DOMAIN_NAME; | |
location / { |