Skip to content

Instantly share code, notes, and snippets.

View likewhoa's full-sized avatar

likewhoa likewhoa

View GitHub Profile
@likewhoa
likewhoa / ftp.py
Created January 7, 2014 05:43 — forked from newbiethetest/ftp.py
# -*- coding:utf8 -*-
__author__ = 'newbie0086#foxmail.com'
import Queue
import threading
from ftplib import FTP
import os,sys,string,datetime,time
import socket
class MyFtp:
def __init__(self,host,username,password,port=21):
self.host=host
queue = Queue.Queue()
out_queue = Queue.Queue()
class ThreadUrl(threading.Thread):
"""Threaded Url Grab"""
def __init__(self, queue, out_queue):
threading.Thread.__init__(self)
self.queue = queue
self.out_queue = out_queue
# -*- coding:utf8 -*-
import urllib
import curl
import pycurl
import StringIO
def initCurl():
c=pycurl.Curl()
c.setopt(pycurl.FOLLOWLOCATION,0)
@likewhoa
likewhoa / slash etc profile
Created August 13, 2013 00:34
A BASH script to show the Sector Size count of drives using smartctl.
chksectorcount() {
local -a drives=(/dev/sd*)
# Iterate through array to remove partitions i.e /dev/sda1 and so on
((n_elements=${#drives[@]}, max_index=n_elements - 1))
for ((i = 0; i <= max_index; i++)); do
if [[ $(echo ${drives[i]} | grep -v '[0-9]') ]]; then
smartctl -a ${drives[i]} | grep "Sector Sizes:"|sed "s:^:${drives[i]} :"
else
@likewhoa
likewhoa / 1. distro.make
Last active December 16, 2015 16:29
Drupal 7 using Commerce Subscription Products.
api = 2
core = 7.x
projects[drupal][type] = core
projects[drupal][download][type] = git
projects[drupal][download][branch] = 7.x
projects[drupal][download][url] = http://git.drupal.org/project/drupal.git