This file contains 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
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 |
This file contains 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
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 |
This file contains 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:utf8 -*- | |
import urllib | |
import curl | |
import pycurl | |
import StringIO | |
def initCurl(): | |
c=pycurl.Curl() | |
c.setopt(pycurl.FOLLOWLOCATION,0) |
This file contains 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
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 |
This file contains 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: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 |
This file contains 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 pycurl | |
import StringIO | |
import re | |
def initCurl(): | |
c=pycurl.Curl() | |
#c.setopt(pycurl.COOKIEFILE,"cookie_file_name") | |
#c.setopt(pycurl.COOKIEJAR,"cookie_file_name") | |
c.setopt(pycurl.FOLLOWLOCATION,0) | |
c.setopt(pycurl.CONNECTTIMEOUT, 1) # | |
c.setopt(pycurl.MAXREDIRS,1) |
This file contains 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 Queue | |
import threading | |
import urllib2 | |
import time | |
from BeautifulSoup import BeautifulSoup | |
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com", | |
"http://ibm.com", "http://apple.com"] | |
queue = Queue.Queue() |
This file contains 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
1. | |
# cat site.make | |
core = 7.x | |
api = 2 | |
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 |
This file contains 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 | |
# Help menu | |
print_help() { | |
cat <<-HELP | |
Arguments: | |
--spec - --spec=stage1.spec (default) | |
--config - --config=/etc/catalyst.conf (default) |
This file contains 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
To download changes from an old livedvd iso image to a new one without having to redownload the whole image, do the following. | |
1. emerge zsync | |
2. zsync -i oldimage.iso http://releases.gentooligans.com/newimage.iso.zsync | |
OlderNewer