Skip to content

Instantly share code, notes, and snippets.

Andrew atr000

  • Boston, MA
Block or report user

Report or block atr000

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View i_ching.dat
2
Ch'en
Earth, mother, people, etc.,
submission.
23
Po
Collapse, splitting apart,
dispersion.
8
Pi
@atr000
atr000 / set_c.py
Created Mar 14, 2011
Sets the FSTypeCode of the given file(s) to the specified code
View set_c.py
#!/usr/bin/env python
"""A very simple script to set FSTYPE info field on a file.
Usage: ./set_c.py [-h] [-t '????'] [-T 1061109567] FILE [...]
Sets the FSTypeCode of the given file(s) to the specified code -
'OggS' by default.
(This script requires Mac-platform python modules.)
"""
View osxSystemDict.py
import sys
import DictionaryServices
def main():
try:
word = " ".join(sys.argv[1:])
except IndexError:
errmsg = 'No term entered to look up in the dictionary'
sys.exit()
wordrange = (0, len(word))
@atr000
atr000 / gatherFinderWindows.scpt
Created Feb 10, 2011
gatherFinderWindows.scpt
View gatherFinderWindows.scpt
tell application "Finder"
-- get desktop dimensions (dw = desktop width; dh = desktop height)
set db to bounds of window of desktop
set {dw, dh} to {item 3 of db, item 4 of db}
end tell
tell application "System Events"
repeat with proc in application processes
tell proc
repeat with win in windows
View findProxy.c
/*
* FindProxies.c
*
* --------------------------------------------------------------------------------------
*
* The contents of this file are subject to the NOKOS License Version 1.0a (the
* "License"); you may not use this file except in compliance with the License.
*
* Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
View sysprefs.m
// (c) 2002 Julien Jalon <jalon@julien-jalon.org>
// See license info at the end of this file.
#import <Foundation/Foundation.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#define PRINT(X) printf("%s\n", [[NSString stringWithFormat:@"%@", (X)] ISOLatin1EncodedCString])
View wol.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main( int argc, char **argv )
{
int i,x,sockfd,an=1;
long n;
char buffer[201];
char mac[102];
View machSandman.c
#include <IOKit/IOKitLib.h>
#include <IOKit/pwr_mgt/IOPMLib.h>
#include <IOKit/IOReturn.h>
#include <mach/mach_init.h> /* for bootstrap_port */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
int main(int argc, char *argv[])
{
@atr000
atr000 / whoami.c
Created Dec 18, 2010
nice util to aid shell/home scripts on finding the remote ip over a ssh connection
View whoami.c
/*
* $Id: //websites/unixwiz/unixwiz.net/webroot/tools/whoamip.c#1 $
*
* written by : Stephen J. Friedl
* Software Consultant
* Tustin, California USA
* http://www.unixwiz.net/tools/
*
* ***********************************************************
@atr000
atr000 / getCaminoURL.scpt
Created Dec 17, 2010
GetCaminoURL.applescript
View getCaminoURL.scpt
-- GetCaminoURL.applescript
-- Created by Thomas Willson on 8/7/09.
-- Copyright 2009 __MyCompanyName__. All rights reserved.
try
tell application "System Events"
set isRunning to ((application processes whose (name is equal to "Camino")) count)
end tell
if isRunning is greater than 0 then
You can’t perform that action at this time.