Skip to content

Instantly share code, notes, and snippets.

View 0312birdzhang's full-sized avatar
:accessibility:
Find a job

BirdZhang 0312birdzhang

:accessibility:
Find a job
View GitHub Profile
@TakWolf
TakWolf / ini.lua
Last active June 19, 2022 00:02
Lua读取ini文件
--===================--
-- INI格式读取工具类
--===================--
ini = {}
--[[
载入一个INI文件
--]]
function ini.load(filename)
local data = {}
@xero
xero / irc.md
Last active May 21, 2024 12:38
irc cheat sheet

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
  • Leaves the specified channel.
@gkazior
gkazior / cas-get.sh
Last active September 22, 2023 12:19 — forked from dodok1/cas-get.sh
#!/bin/bash
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST="$1"
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'`
#IP Addresses or hostnames are fine here
CAS_HOSTNAME=galaxy:9143
@skvark
skvark / sailfishsdkrepos.md
Last active April 4, 2024 04:50
Describes how to add repositories to Sailfish OS SDK (emulator and targets) and how to install them so that they can be used straight from the SDK.

This guide uses my own repos from Mer Obs. I found it very hard to find information about this so hopefully someone sees this useful. This short guide was created as a side product while I was creating these RPM packages (which wasn't so clear to me either).

  1. Add the repositories to the Mer SDK armv7hl and i486 targets (you'll have to ssh to the Mer SDK):

    • sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_armv7hl tesseract-ocr
    • sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_armv7hl leptonica
    • sb2 -t SailfishOS-i486 -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_i486 tesseract-ocr
    • sb2 -t SailfishOS-i486 -m sdk-install -R zypper ar -f http://repo.merproject.org/obs/home:/skvark/latest_i486 leptonica
  2. Refresh sb2 -t SailfishOS-i486 -m sdk-install -R zypper ref and sb2 -t SailfishOS-armv7hl -m sdk-install -R zypper ref

# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST="$1"
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'`
#IP Addresses or hostnames are fine here
CAS_HOSTNAME=team.eea.sk
#Authentication details. This script only supports username/password login, but curl can handle certificate login if required
USERNAME=$2
@rswofxd
rswofxd / PySched.py
Created June 23, 2012 10:45
Python:任务调度,定时执行
#coding=utf-8
import time
import sched
import os
import threading
"""
sched模块,准确的说,它是一个调度(延时处理机制),每次想要定时执行某任务都必须写入一个调度。
使用步骤如下:
(1)生成调度器:
s = sched.scheduler(time.time,time.sleep)