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
// Copyright 2012 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// +build !plan9 | |
package main | |
import ( | |
"log" |
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 | |
source ./admin.sh | |
nova list --all-tenant | grep ERROR|awk '{print $2}' > ./uuid.temp | |
cat ./uuid.temp | xargs -n1 nova reset-state --active | |
cat ./uuid.temp |xargs -n1 nova reboot --hard | |
rm -f ./uuid.temp |
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 os.path, os, time, datetime | |
time_now = datetime.datetime.now() | |
for root, dirs, files in os.walk("image"): | |
for file_name in files: | |
file_path = root + '/' + file_name | |
file_exten = os.path.splitext(file_name)[1] | |
if not file_name[0] == '.': | |
if (file_exten == '.jpg' or file_exten == '.png' or file_exten == '.JPG' or file_exten == '.mp4' or file_exten == '.jpeg' or file_exten == '.mov' or file_exten == '.gif'): | |
#m_time = datetime.datetime.fromtimestamp(os.path.getmtime(file_path)) | |
new_file_name = time_now.strftime('%Y-%m-%d %H.%M.%S') + file_exten.lower() |
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
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
from multiprocessing import Process | |
from time import sleep | |
import tkinter as tk | |
class Application(tk.Frame): | |
def __init__(self, master=None): | |
tk.Frame.__init__(self, master) |
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
# -*- coding: utf-8 -*- | |
# !/usr/bin/python | |
# Filename: change_tint2_color.py | |
# 删除某个文件夹里的讨厌的空白图像(圣光) | |
from PIL import Image | |
import fnmatch | |
import os |
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 | |
#This is a PyGTK test | |
import gtk | |
import sys | |
class PyApp(gtk.Window): | |
def __init__(self): | |
super(PyApp,self).__init__() | |
self.set_title("PWM") | |
self.set_size_request(250,200) |
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
#include<reg52.h> | |
#include<stdio.h> | |
#define uchar unsigned char | |
#define uint unsigned int | |
#define KongNums 20 //码盘上孔的数量 | |
#define HighTime 500 //高电平持续时间 | |
#define LowTime 500 //低电平持续时间 |
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
\documentclass[12pt,landscape]{article} | |
\usepackage{geometry} | |
\geometry{verbose,letterpaper} | |
\usepackage{movie15} | |
\usepackage{hyperref} | |
\begin{document} | |
Whispering-gallery mode in a auarter circle: | |
\begin{figure}[ht] | |
\includemovie[ | |
poster, |
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/env bash | |
#Filename: change_brightness.sh | |
#这个脚本会根据当前时间来改变系统屏幕的亮度,最好配合crontab来使用,而且我把他放在了/etc/rc.local中开机执行. | |
current_time=`date +%H` | |
case $current_time in | |
0|1|2|3|4|5|6|22|23) | |
#echo 'Night' | |
#这一句得用root权限来执行(sudo在这里也不行) | |
echo 0 > /sys/class/backlight/acpi_video0/brightness | |
#now=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
#!/usr/bin/env bash | |
#Fielname: shiftwallpaper(.sh) | |
WALLPAPER_DIR='/home/kaleo/images/wallpapers/shared' | |
WAIT=1800 | |
function load_wallpapers() | |
{ | |
n=0 |