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
#!/usr/bin/python | |
import os | |
class Pwd(): | |
def __repr__(self): | |
return os.getcwd() + "% " | |
if __name__ == '__main__': | |
while True: | |
dir = raw_input(Pwd()) |
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
#!/usr/bin/perl | |
# -*- coding: utf-8 -*- | |
# for VimShell | |
#Author: mfumi <[email protected]> | |
#Version: 0.0.3 | |
#License: NEW BSD LICENSE | |
# Copyright (c) 2010, mfumi | |
# All rights reserved. |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use GD::Graph::linespoints; | |
use GD::Graph::colour qw(:colours); | |
use GD::Text; | |
#データファイルのオープン | |
open DATA ,"<data.txt" or die("Can't Open data file"); |
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 0.01 s | |
2 0.02 s | |
3 0.07 s | |
4 0.12 s | |
5 0.17 s | |
6 0.21 s | |
7 0.33 s | |
8 0.61 s | |
9 0.93 s | |
10 1.50 s |
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 socket | |
import Skype4Py | |
PORT = 50000 | |
skype = Skype4Py.Skype() | |
skype.Attach() | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) |
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 socket | |
import sys | |
PORT = 50000 | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
s.connect(('localhost',PORT)) | |
s.send(sys.argv[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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char const* argv[]) | |
{ | |
int temp = 0; | |
char unit; | |
FILE *file = fopen("/Users/mfumi/.screen/.temp","r"); | |
if(file != NULL){ | |
fscanf(file,"%d %c",&temp,&unit); |
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
#include <mach/host_info.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
struct host_basic_info host; | |
struct vm_statistics vm_info; | |
mach_msg_type_number_t count; | |
kern_return_t kr; | |
vm_size_t pagesize; |
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
/* Show CPU Usage */ | |
#include <mach/mach.h> | |
#include <mach/mach_error.h> | |
#include <stdio.h> | |
int main() { | |
natural_t cpuCount; | |
processor_info_array_t infoArray; | |
mach_msg_type_number_t infoCount; | |
kern_return_t kr; |
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/sh | |
ioreg -n AppleSmartBattery | \ | |
awk '/MaxCapacity/ {MAX = $5} | |
/CurrentCapacity/ {CURRENT = $5} | |
/InstantTimeToEmpty/ {REMAIN = $5} | |
END { | |
printf("HP%d ",CURRENT/MAX*100) | |
if(REMAIN > 1000) | |
if(CURRENT == MAX) printf("(Charged)") |