Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Lee Tang D0zingcat

🎯
Focusing
Block or report user

Report or block D0zingcat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@D0zingcat
D0zingcat / linux calendar
Created Jan 31, 2018
A simple unix calendar implementation in python
View linux calendar
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import os
def print_months(year, month):
if year < 1900:
View 2017.12.02
https://ide.c9.io/d0zingcat/dailylabs | dailylabs - Cloud9
https://miki725.github.io/docker/crypto/2017/01/29/docker+nginx+letsencrypt.html | Docker + Nginx + LetsEncrypt — » Miroslav Shubernetskiy
https://github.com/jwilder/nginx-proxy | jwilder/nginx-proxy: Automated nginx proxy for Docker containers using docker-gen
https://github.com/clarkzjw/nginx-proxy-google | clarkzjw/nginx-proxy-google: Docker image of Nginx reverse proxy for Google
https://stackoverflow.com/questions/24241292/dockerized-nginx-is-not-starting | docker - Dockerized nginx is not starting - Stack Overflow
https://bitbucket.org/account/signin/
https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html | Set up an SSH key - Atlassian Documentation
https://hub.docker.com/ | Docker Hub
https://www.linux.com/news/5-linux-desktop-environments-rise-2017 | 5 Linux Desktop Environments on the Rise for 2017 | Linux.com | The source for Linux information
https://www.ubuntupit.com/install-various-desktop-environment-ubuntu/ | 13 B
View markdown notes.md
  1. Anchor at current page Github automatically parses anchor tags out of your headers. So you can do the following:
[Foo](#foo)
### Foo

In the above case, the Foo header has generated an anchor tag with the name foo

Note: just one # for all heading sizes, no space between # and anchor name, anchor tag names must be lowercase, and delimited by dashes if multi-word. Just like this:

View swiss-army knives.md

Text processing

Name Usage
Pandoc Convert one markup format to another

Community

Name Usage
Launchpad A software collaboration platform that engages developer developing softwares on Ubuntu
View git notes.md
commands scope common user cases
git reset Commit Discard commits in a private branch or throw away uncommited changes
git reset File Unstage a file
git checkot Commit switch between branches or inspect old snapshot
git checkout File Discard changes in the working directory
git revert commit Undo commits in a public branch
git revert File 不支持
git push -u origin master persistence on next push, "origin master" can be ommitted.
View linux notes.md

Without other narrates, this note is only intended for Debian or Ubuntu.

command function usage
update-alternatives multi-version runnable program preference management
test -x ${file} test if ${file} exists and granted with executable permission
if [ -f ${file} ] test if this file is a regular file
set -e cause the shell to exit if any subcommand or pipeline returns a non-zero status
View mess notes.md

Docker notes

  1. docker Network differenece between EXPOSE and PUBLISH: Exposing ports is a way of documenting which ports are used, but does not actually map or open any ports. Exposing ports is optional.

Best practives in [?]nix

command line proxy: proxychains

View java notes.md

单例模式

单例模式的主要作用是保证在Java程序中,某个类只有一个实例存在。一些管理器和控制器常被设计成单例模式。

单例模式有很多好处,它能够避免实例对象的重复创建,不仅可以减少每次创建对象的时间开销,还可以节约内存空间;能够避免由于操作多个实例导致的逻辑错误。如果一个对象有可能贯穿整个应用程序,而且起到了全局统一管理控制的作用,那么单例模式也许是一个值得考虑的选择。

Maven

View 20170913
https://www.google.com.hk/search?newwindow=1&q=compile+nginx&oq=compile+nginx&gs_l=psy-ab.3...391087.392005.0.392239.7.6.0.0.0.0.288.288.2-1.1.0....0...1.1.64.psy-ab..7.0.0.LWGlKWnAerY | compile nginx - Google Search
https://www.nginx.com/resources/admin-guide/installing-nginx-open-source/ | How to Install NGINX Open Source | NGINX
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-16-04-server | How To Configure Nginx as a Web Server and Reverse Proxy for Apache on One Ubuntu 16.04 Server | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04 | How To Set Up Nginx Server Blocks (Virtual Hosts) on Ubuntu 16.04 | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04 | How To Install Nginx on Ubuntu 16.04 | DigitalOcean
https://www.digitalocean.com/community/tutorials/how-to-configure-the-nginx-web-server-on-a-virtua
@D0zingcat
D0zingcat / picpatch.py
Created Mar 30, 2017
This is a py-program to patch JPEG Photos to prevent auto-rotate in markdown files.
View picpatch.py
from PIL import Image
import os, argparse, pexif
def picProcessing(picPath, isForce=False):
try:
img = pexif.JpegFile.fromFile(picPath)
You can’t perform that action at this time.