Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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
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 / 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

@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