• Stars
    star
    184
  • Rank 209,187 (Top 5 %)
  • Language
    Shell
  • License
    Other
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

subjective but sensible defaults for shell use. Ubuntu, OSX, FreeBSD tested.

Humanism.sh

These commands attempt to introduce some humanism to POSIX users by providing sensible defaults to basic commands and changing the basic functionality of some so as to free neurons for use on something other than remembering command flags. This effort ignores with intent the response "it only takes you one more second to do it the normal way."

Examples: cd use typically includes only one argument: a directory. With that assumption this seems absurd: cd ./to\ some\ directory. And history and ps are rarely used without grep. find is typically used to fuzzy search for a file name so why isn't -iname "*$@*" the default?

Some commands herein alter workflow more intrusively. The c command, intended to replace cd, will search forward and backward looking for a directory that matches any part of the argument filter. Though subtle this change makes moving through the file systems similar to using command launchers found in modern OS UI's (cmd+space osx, alt+F2 ubuntu). The ap command unifies package searching, installation and information making finding needed dependencies or files easier. sshrc can be used to carry humanism (inspired by Russen91's sshrc). alias ssh=sshrc and take it wherever you go.

Installation

To load all commands for each new terminal shell (bash/zsh/sh compatible) source the file in your profile or bashrc:

source humanism.sh

Alternatively you can load commands selectively source humanism.sh <cmd> or execute humanism.sh help to see list of commands.

You are likely use ap and in some cases dbg via sudo/root so link these scripts into a PATH'ed bin:

sudo ln -s <humanism.sh_path>/dbg /usr/local/bin
sudo ln -s <humanism.sh_path>/ap.<version> /usr/local/bin

Commands have been tested on OSX, Ubuntu and FreeBSD and various virtual hosts and embedded devices. If you find errors please execute the dependency test script sh -x test/requirements.sh and submit an issue on github.

Use

c (cd)

c            go to last dir
c <FiLteR>   go to path, if not in cwd search forward and backward for
             *FiLtEr* in tree

example c use

Details:

c <fIlTeR>            go to path or find and goto filter  
                      1. if filter is path, goto  
                      2. if filter is name in tag db, goto  
                      3. if filter found under cwd, goto  
                      4. if filter found above cwd, goto
c <fIlTeR> <fIlTeR>   filter cascading. find filter, then Nth filter under it  
c <tag> <tag>         tag cascading
c <tag> <fIlTeR>      combined. many tags, one filter  
l <tag> <fIlTeR>      ls that adheres to all of the above  

Managing Tags:

Tags get created either manually using these commands or automatically when a c fIlTeR is found.

cc                    list tags  
cc <tag>              add/remove/rename <tag> for pwd  
                      prompt to delete if <tag> exists  
cc d   <tag>  
cc del <tag>          explicit delete  

To disable auto tagging set HUMANISM_C_TAG_AUTO=0 before sourcing humanism.sh

find

find <filter>          find *FiLtEr* anywhere under cwd
find <path> <filter>   find *FiLtEr* anywhere under path
find $1 $2 $3 ...      pass through to normal find

example find use

history

history            list
history <filter>   greped history

example history use

ps

ps                            list
ps <filter>                   filtered
ps <filter> | killps [-SIG]   kill procs

log

Used to create a record of work by appending commands and messages to ./run.sh from bash history.

log          	   show recent commands and select which are recorded
log some message   append echo message to run.sh
log <N>      	   append Nth cmd from last. e.g. ``log 1``    adds last cmd

ap

Unify apt-get, apt-cache and dpkg on Linux, homebrew on OSX or pkgng on Freebsd. Makes searching for needed files or packages a bit easier.

install)  
Install package

reinstall)  
Re-install package

remove)  
Uninstall and purge of all deps no longer required

updatesecurity)  
Install security updates

search)  
Show packages available or already installed

ownerof)  
Show package for file

ineed)  
Show packages that would provide a file if installed

ineedbadly)  
Show any package that contains string

info)  
information about package

list)  
show files installed by package

*)  
pass through any other command on to apt-get

dbg

Unify strace|dtruss and lsof.

trace)
 strace all child processes of supplied command, pid or proc name

openfiles)
 Show open files of an already running processes and its children, by name

fileprocs)
 Show pid's touching file

libtree)
 using strings alone give .so dependency for file
 use: dbg libtree <TARGET> [ignorelibs]
 ie:  dbg libtree <TARGET> [ld.so.1 libc.so libpthread.so.0 libc.so.6]

canexe)
 pick an executable and it's dependencies.
 e.g. grab arm executables from one firmware and use on another

 tries to determine libs with ldd first, then dbg libtree

 use: dbg canexe <TARGET> [ignorelibs]
 ie:  dbg canexe <TARGET> [ld.so.1 libc.so libpthread.so.0 libc.so.6]

demanglecpp)
 pipe strings into c++filt to demangle names

sshrc

carry all of the above commands with you. Will source myrc file from humanism.sh base directory, if it exists. Personally I've set alias ssh=sshrc in myrc so that I don't forget to carry this with me.

More Repositories

1

JTAGenum

Given an Arduino compatible microcontroller or Raspberry PI (experimental), JTAGenum scans pins[] for basic JTAG functionality and can be used to enumerate the Instruction Register for undocumented instructions. Props to JTAG scanner and Arduinull which came before JTAGenum and forwhich much of the code and logic is based on. Feel free to branch and modify religiously (readme, credits, whatever)
C++
716
star
2

RS232enum

When you are presented with pins that you suspect provide Serial but you do not have access to the documentation. Connect your Arduino to all of the pins (limited by the number of Ditial pins you have on your board) and this sketch will try every possible pin combination and baud rate to determine RX/TX. It will also try to send wakeup characters to stimulate the line, such as a carriage return or other txpatterns that you add. This code sends data using a custom SoftwareSerial library.
C++
84
star
3

NANDDump

dump NAND FLASH memory chips
Arduino
46
star
4

ParallelFLASHDumper

Dump NOR/Parallel FLASH memory chips using an Arduino or Raspberry Pi
Arduino
40
star
5

snifferjs

Sniffer.js packet sniffer in nodejs, browser or experimental standalone app (electron)
JavaScript
38
star
6

sectk

## No more updates as of early 2010. ## Security Toolkit for hardware and software reverse engineering. Online information is not forever and some tools are too important to loose so I started archiving the important ones I use. I comment and link to the originals religiously so be sure to check the README in each directory.
Standard ML
37
star
7

op1vacation

Backup albums,tracks,samples from Teenage Engineering OP-1 to Raspberry Pi Zero
Shell
26
star
8

entropy_examples

Showing entropy analysis examples for different data types. example.sh was used to generate. It utilizes cyphunks libdisorder branch and gnuplot.
Shell
11
star
9

sbdl

Secure Boot Definition Languag
Ruby
10
star
10

jstor_archive

JSTOR_archive provides scripts to download and save in PDF/HTML form articles added to a free-user's shelf on the Journal Storage archive site JSTOR
Shell
3
star
11

coupwn

ticket and coupon sharing via smart phones with tor. Collaboration with https://github.com/src. This is very basic exploratory code meant for the nokia n900. Meaning, this is just a code dump at the moment. This only supports injecting messages (tickets?) to the local SMS DB. Still need server code and tor setup/support
C++
3
star
12

FLASHSwap

Using CF/SD and other consumer medium to dump embedded FLASH; STATUS: on hold
2
star
13

pitheatre

Raspberry Pi configurations I use often to quickly get prototypes running for theatre projects
Shell
2
star
14

NetworkGamma

A silly command line tool for OSX that accepts r,g,b gamma thresholds from the network. hacked up for an Interaction Design concept. It took a good bit of digging in sporadic related code i could find and obscure documentation to figure out how to access the Gamma API so leaving this here just incase someone needs it for reference.
C
2
star
15

pd-for-phonegap

PureData ported to the phonegap mobile framework (andriod/ios)
Objective-C
1
star
16

Grey

Exploration of UI aesthetics when color removed. Forces OSX into monochrome mode. Shortcut key to turn color on briefly. FYI: Yosemite provides an option to force grey scale in its settings panel
Objective-C
1
star
17

Panasonic-HVX200-GPL-sources

These are the GPL sources received from a GPL release request to Panasonic for their HVX200 HD camera
1
star
18

primitive.sh

scripts that bypass linux distro to manage system basics
Shell
1
star
19

haironyourhead

for hair on your head theatre show. currently undocumented and not meant for public consumption
HTML
1
star