Skip to content

Instantly share code, notes, and snippets.

@hnuzhoulin
hnuzhoulin / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hnuzhoulin
hnuzhoulin / python_resources.md
Created May 10, 2015 05:40 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

cluster:
head: "cbt"
clients: ["client1","client2","client3"]
osds: ["osd1","osd2","osd3"]
mons: ["mon1","mon2","mon3"]
osds_per_node: 1
fs: xfs
mkfs_opts: -f -i size=2048 -n size=64k
mount_opts: -o inode64,noatime,logbsize=256k
conf_file: /etc/ceph/ceph.conf
@hnuzhoulin
hnuzhoulin / multi_thread_parallel
Created November 7, 2016 02:42 — forked from anonymous/multi_thread_parallel
using python archive thread parallel
#!/usr/bin/env python
#coding: utf-8
import os
import sys
import logging
from threading import Thread
import Queue
@hnuzhoulin
hnuzhoulin / howto-remote-access-to-phpMyAdmin-on-bitnami.md
Created November 17, 2016 07:48 — forked from minazou67/howto-remote-access-to-phpMyAdmin-on-bitnami.md
How to remote access to phpMyAdmin on Bitnami Redmine Stack

How to remote access to phpMyAdmin on Bitnami Redmine Stack

Bitnami Redmine Stack の phpMyAdmin にリモート端末からアクセスする方法です。

Environment

  • Debian jessie
  • bitnami-redmine-3.1.0-0-linux-x64
@hnuzhoulin
hnuzhoulin / crush_data_movement_calculator.py
Created February 15, 2017 00:45 — forked from alram/crush_data_movement_calculator.py
Calculate how much data will move before applying a CRUSHmap change
#!/usr/bin/env python
import ast
import json
import os
import subprocess
import argparse
import sys
FNULL = open(os.devnull, 'w')
@hnuzhoulin
hnuzhoulin / AllResolutions.ps1
Created May 25, 2017 08:01 — forked from mintsoft/AllResolutions.ps1
Powershell for getting all resolutions from all monitors
$pinvokeCode = @"
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
namespace Resolution
{
[StructLayout(LayoutKind.Sequential)]
public struct DEVMODE1
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
@hnuzhoulin
hnuzhoulin / seamake.sh
Created June 6, 2017 06:50 — forked from theclanks/seamake.sh
seafile client build
#!/usr/bin/env bash
yum install vala vala-compat wget gcc libevent-devel openssl-devel gtk2-devel libuuid-devel sqlite-devel jansson-devel intltool cmake qt-devel fuse-devel
echo "Building and installing seafile client"
export version=4.2.8 # change this to your preferred version
alias wget='wget --content-disposition -nc'
wget https://github.com/haiwen/libsearpc/archive/v3.0.2.tar.gz
wget https://github.com/haiwen/ccnet/archive/v${version}.tar.gz
@hnuzhoulin
hnuzhoulin / seafile-backup.sh
Created June 6, 2017 07:39 — forked from 3c7/seafile-backup.sh
Seafile backup script
#!/bin/bash
###############################
# Seafile server backup script (cold sqlite backup)
# Author: Nils Kuhnert
# Last change: 2014-07-27
# Website: 3c7.me
###############################
# Variables
DATE=`date +%F`
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = 'Nisests'
import requests
from bs4 import BeautifulSoup
login_url = 'https://www.packtpub.com/'
accout_url = 'https://www.packtpub.com/account'