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
| upstream server2{ | |
| server 127.0.0.1:9000; | |
| } | |
| server { | |
| listen 80; | |
| server_name 119.xx.xx.xx; | |
| client_max_body_size 4G; |
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
| #!/bin/bash | |
| # phone symmmetric brightness function: y=200*sin(0.2361*x-1.31)+0 | |
| # run as root. executed by tasker. | |
| A=200 | |
| w=0.2361 | |
| t="-1.31" | |
| c="0" | |
| now=`date | awk -F ' ' '{print $4}'` | |
| hour=`echo $now | awk -F ':' '{print $1}'` |
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 -m http.server | |
| # or | |
| python2 -m SimpleHTTPServer | |
| # If not working, check your firewall and restart server. |
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
| # auto mount network folder: | |
| 192.168.1.x:/home/i/Desktop /home/i/Desktop/xxx nfs rw,auto,sync,rsize=8192,wsize=8192,timeo=14,intr 0 0 |
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 matplotlib | |
| from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
| from matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg | |
| from numpy import arange, sin, pi | |
| import tkinter as tk | |
| matplotlib.use('TkAgg') | |
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
| try: | |
| import Tkinter as tk | |
| except ImportError: | |
| import tkinter as tk | |
| class Observable: | |
| def __init__(self, initialValue=None): | |
| self.data = initialValue | |
| self.callbacks = {} |
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 tkinter as tk | |
| class SimpleTableInput(tk.Frame): | |
| def __init__(self, parent, rows, columns): | |
| tk.Frame.__init__(self, parent) | |
| self._entry = {} | |
| self.rows = rows | |
| self.columns = columns |
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 tkinter as tk | |
| import sys | |
| class ExampleApp(tk.Tk): | |
| def __init__(self): | |
| tk.Tk.__init__(self) | |
| toolbar = tk.Frame(self) | |
| toolbar.pack(side="top", fill="x") | |
| b1 = tk.Button(self, text="print to stdout", command=self.print_stdout) |
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 tkinter as tk # python 3.x | |
| # import Tkinter as tk # python 2.x | |
| class Example(tk.Frame): | |
| def __init__(self, parent): | |
| tk.Frame.__init__(self, parent) | |
| # valid percent substitutions (from the Tk entry man page) |
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
| #!/usr/bin/python | |
| try: | |
| import SimpleHTTPServer | |
| except: | |
| import http.server as SimpleHTTPServer | |
| try: | |
| import SocketServer | |
| except: | |
| import socketserver as SocketServer | |
| PORT = 8000 |