The internet has made learning about computers possible for me. Sharing that enthusiasm could be classed as “teaching” but teaching and learning are intrinsically coupled.
“Fortunately, the complexity of the Iridium air interface should make the challenge of developing an Iridium L-Band monitoring system very difficult and probably beyond the reach of all but the most determined adversaries” - Iridium LLC
Driving the RF1101SE-v3.1 with a Teensy microcontroller
This week I spent a couple of days fighting with, testing, and then finally releasing some working code that drives a Texas Instruments CC1101 based board with the fabulous Teensy from PJRC. I also include some code to configure Michael Ossmann’s Yard Stick One which has become an indespensible device for working with packet-based radios.
Today I was transmitting a ‘Wide Band Frequency Modulation’ (WBFM) encoded radio in a carrier wave with Michael Ossmann’s Software Defined Radio (SDR) peripheral, HackRF.
I leave my experience here as breadcrumbs for others who follow in the path of learning Digital Signal Processing (DSP)
Thursday (20th August 2015) is my last day with Greenpeace International.
For the last three years I’ve been based in Amsterdam as Team Leader of Greenpeace International’s Local Information Technology team. Stretching the boundaries and ideas around what a technology team could & should be in a modern organisation.
The new top level domains (TLD’s) have been a long time coming and while I will hold on to gareth.com.au (Company, Australia) & gyaresu.org (Organisation) it seems fitting to use a new domain as a symbolic break from the past and launchpad for new adventures.
My username everywhere on the internet is gyaresu (ギャレス) because I was studying Japanese at the time of my internet birth.
gyaresu san is the Japanese representation of Gareth plus the common honorificsan. It’s hard to pronounce for anyone unaquainted with Nihongo so I’ll leave this audio file here to help you out:
A hacker is one who enjoys the intellectual challenge of creatively overcoming and circumventing the limitations of programming systems. And in doing so, tries to extend their capabilities.
The act of programming in a spirit of playfulness and exploration is termed hacking.
It’s build on a super awesome stack of awesomeness and not only gives me a solid foundation for a tool I want to build but it’s a great insight into modern ECMAScript 6 (ES6) programming.
I’ll follow up with a post on the tools used in this modern web stack but first a ‘hat tip’ to Glenn and his licencing of TypeSlab to the GNU Affero General Public Licence
If we’re going to solve the serious, existential risks to the human race – things like environmental apocalypse – we’re going to need social and technical infrastructure that can support evidence-driven, public-spirited institutions that can help steer us to a better place.
Alas, we’re in trouble there, too. We’re living in a nearly airtight bubble of corruption and coercion. The only policies that states can reliably be expected to enact are those with business models – laws and actions that make someone incredibly rich, producing the private wealth necessary to lobby state to continue the policy and keep the money flowing.
There’s always been practical limits to how wide the gap between the rich and poor can get – at a certain point, elites end up spending more money guarding their wealth from the ever-enlarging, ever-more-desperate cohort of poor than they’re getting from corrupt policies and self-dealing relationships with the state.
But technology changes all that. The automation of surveillance and coercion makes the business of maintaining social order vastly cheaper, and therefore increases the amount of wealth the very richest can keep to themselves rather than doling out dribs and drabs to the rest of us.
Thus the miseries of a technologically supported system of feudalism dwarf those of the darkest days of kings and lords. And the ever-dwindling accountability of ruling elites means that evidence-driven policy is harder and harder to enact, and when it is, that policy needn’t be in the common interest.
We need to crack the airtight bubble. We need to find a way to begin unravelling the knotwork of decades of neoliberal corruption.
The first step to this is to seize the means of information. We need computers that we do what we tell them to do, and networks that we can trust, in order to carry out a program of popular reform for good governance, fairness, and equity.
We can do this, and we will do this. Because this is a policy with a business-model, and policies with business-models are the only policies the modern state can be relied upon to enact.
An attempt to describe our engineering culture. This is a journey in progress, not a journey completed, so the video is somewhere between 'How Things Are Today' and 'How We Want Things To Be’.
JavaScript is awesome. It's easy to learn partially, and much harder to learn completely (or even sufficiently). When developers encounter confusion, they usually blame the language instead of their lack of understanding. These books aim to fix that, inspiring a strong appreciation for the language you can now, and should, deeply know.
functionfoo(){// Function definition doesn't create a `this`varbob=7;console.log(this.bob,// => 2 Implicit binding means `this.bob` is the `bob` from within `obj`bob,// => 7 `bob` is only local to foothis.thing// => 'stuff' Again, foo is called in obj giving it access to local `thing`);}varobj={bob:2,thing:'stuff',foo:foo// This is where obj.foo() gets called from and `this` is bound};obj.foo();// 2 7 'stuff'
Often times you start with a programming language, a framework, or a library and it really feels like they move straight from the ‘todo’ app to building Facebook.
```TShark is a network protocol analyzer. It lets you capture packet data from a live network, or read packets from a previously saved capture file, either printing a decoded form of those packets to the standard output or writing the packets to a file. TShark’s native capture file format is pcap format, which is also the format used by tcpdump and various other tools.
```Without any options set, TShark will work much like tcpdump. It will use the pcap library to capture traffic from the first available network interface and displays a summary line on stdout for each received packet.
The Dunning–Kruger effect is a cognitive bias wherein unskilled individuals suffer from illusory superiority, mistakenly assessing their ability to be much higher than is accurate. This bias is attributed to a metacognitive inability of the unskilled to recognize their ineptitude. Conversely, highly skilled individuals tend to underestimate their relative competence, erroneously assuming that tasks which are easy for them are also easy for others.
Sheryl Sandberg even called it “the most important document ever to come out of the Valley.” It’s a living set of “behaviors and skills” that the Netflix management team updated continuously and fastidiously. And it drives toward a single point: a company is like a pro sports team, where good managers are good coaches, and the goal is to field stars in every position.
I love Nodeschool workshops and this was one of the better ones. Great weekend fun finding the solutions and I definitely want to continue using Hapi.
</br>
Proficient enough at the end to just start writing code? Yep.
</br>
&yet Present Eran Hammer on Hapi 2.0 - Jan 2014
</br>
And how's this for an instant proxy?
1varHapi=require('hapi');// Import the library23varserver=newHapi.Server('localhost',(process.stdin[2]||3000));// Host and port you designate or port 300045server.route({6method:'*',// Any of the HTTP methods7path:'/{path*}',// Any path and follow recursively8handler:{9proxy:{10host:'google.com',// http://localhost:3000/search?&q=hapijs11redirects:5,// Sixth redirect gives back error 30012}13}14});1516server.start();// kick it
</br>
TODO: Read up on Function expressions vs. Function declarations
Nonprofit work is hard work. It is complex, adaptive work where the answers are not known in advance — we have to invent them as we go. Most nonprofits are tackling huge problems with few resources and many face deep-pocketed opposition.
Nonprofit work is long-term work. The problems we’re working on — climate change, inequality and injustice — didn’t emerge overnight, and we’re not going to solve them in a couple of years.
Because nonprofit work is hard, long-term work, the nonprofit sector needs to attract the most talented people we’ve got — and keep them around long enough for them to become wise and masterful practitioners.
The skills and talent nonprofits need to solve big social problems are complex . We need to be able to draw in people with a broad range of experiences, skills and talents. Failure to do this not only hurts us tactically, it limits us strategically.
Right now, access to wealth — inherited wealth, earned wealth from a prior career or spouses/partners who are the primary breadwinners in their households — is often an implicit filtering criterion for long-term nonprofit employment. This perpetuates and deepens the structural racism and inequity in our society, even as we say we are working to eliminate it.
The student debt crisis is a huge, largely unacknowledged talent problem in the making for the nonprofit sector. While many millennials are drawn to mission-based work, their student debt will prevent them from entering the sector, or ensure that their stay here is short.
The skills that it takes to build and sustain a successful and effective nonprofit are becoming more varied.
Because of the explosion of nonprofits — and the immediate accessibility of a global audience afforded by the internet — nonprofits must not only be skillful at more things, they must be relatively more skillful at more things if they want to break away from the pack. The bar for success is, paradoxically, rising, even as the barriers to starting a nonprofit are falling.
The skills that nonprofits must master to succeed in the twenty-first century are rapidly converging with the skills that organizations in other sectors must master to succeed.
We can see this most clearly in the area of technology. But it’s not just technology, it’s also finance, leadership, marketing and more.
The rise of mission-based “social enterprise” businesses and B-Corps further exacerbates the nonprofit’s sector’s intensity of competition for talented, mission-minded people.
Nonprofits are therefore competing beyond the sector for talent more directly than ever before and the intensity of this competition is only going to continue to increase.
Nobody expects (or deserves) to get rich working for a nonprofit.
Many nonprofits are (or can be) amazing places to work. People will sacrifice some amount of money for challenge, meaning, flexibility and autonomy.
Despite this, we should not expect nonprofit workers to forgo home ownership, children and a secure retirement in order to work in the sector.
If nonprofits want to successfully compete for talent — and keep good people around for the long haul, they need to pay enough so that money isn’t an issue, then out-compete other employers on meaning, relationships, autonomy and opportunity.
The amount of money that makes “money not be an issue” for the diverse, talented people we need to attract and retain is often more than the median nonprofit is paying right now.
The amount of money that makes “money not be an issue” for the diverse, talented people we need to attract and retain is not insanely large. People who are drawn to and can succeed at the complex, adaptive challenges of nonprofit work tend to have strong intrinsic motivation and are rarely highly materialistic.
There are many roles in nonprofits for which it is believed to be difficult to objectively and fairly evaluate employee performance and/or contribution to either the organization’s bottom line or its mission impact.
Nonprofits rarely cut low performing staff.
Nonprofits rarely if ever pay their top performers significantly more than their median or low performers.
Most nonprofits would rather spend additional dollars growing their team or launching new programs and accept turnover as a “fact of life” than invest in retaining their best people for the long haul.
Nonprofits rarely account for the full costs of turnover: lost relationships, lost knowledge, lost productivity, damage to morale, etc.
Nonprofits rarely account for the full costs of turnover: lost relationships, lost knowledge, lost productivity, damage to morale, etc.
Many of the nonprofit sector’s most highly skilled people eventually are forced to leave the sector entirely or go into private practice as consultants in order to meet their financial needs.
The “consultant-ization” of the nonprofit sector has some benefits (e.g. rapid, flexible team formation, deep specialization, diffusion of knowledge, etc.) but also considerable costs.
While nonprofit culture and management practices contribute to some of the sector’s dysfunctions around compensation, nonprofit board members, donors and funders play a significant role in shaping the sector’s culture and determining how it allocates resources.
The overhead myth, preferences for new programs over proven effectiveness, underinvestment in leadership development, failure to admit and embrace failure — these phenomena all contribute to unhealthy ideologies about compensation in the nonprofit sector.
Nonprofit boards rarely involve themselves in staff salary structures or policies, restricting themselves to setting CEO compensation and perhaps approving incremental increases to the overall salary pool during the budgeting process.
Foundation program officer salaries often serve as an effective upper bound on nonprofit CEO compensation.
Funders rarely reward their highest-performing grantees with game-changing infusions of general support dollars — and even more rarely do they cut their low-performing grantees to free up resources for their high performers.
Many funders are happy to reward effort rather than results. This is closely tied to risk aversion, because big results require big risks and it is often hard to claim credit for long-term success.
There is no silver bullet solution to these challenges, but the nonprofit and philanthropic sectors must work together to open a more courageous conversation if we are to make progress.
FFmpeg is one of the core tools you don’t know you need until you need it.
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It contains libavcodec, libavutil, libavformat, libavfilter, libavdevice, libswscale and libswresample which can be used by applications. As well as ffmpeg, ffserver, ffplay and ffprobe which can be used by end users for transcoding, streaming and playing.
I just used it to strip a 6GB iPhone video file down to the 21MB audio actually needed.
Welcome to the future. All your radio frequencies are belong to me.
The HackRF is a Software Defined Radio (SDR) device.
It will allow me to transmit and receive all frequencies between 10MHz and 6GHz while using a computer to shape those waveforms. Normally only possibly with rooms full of expensive dedicated equipment.
When hackers got access to cheap SDR WiFi cards, that's when WiFi was broken (WEP/WPA/WPA2) and now it's time for everything from GSM phones, to 1970's satellites to come under scrutiny.
Incredible tools lead to amazing discoveries.
It's a great time to be a geek.
Attached is a zip file containing two text files.
I’ve removed most character-type garbage and (non-visible) termination characters.
I wouldn’t use it to import into a database but this should be adequate for your stated requirements.
Should you wish any further alterations please don’t hesitate to ask.
Final command used to clean, sort, remove duplicates, reshuffle and output to separate file:
Gallup has found that one of the most important decisions companies make is simply whom they name manager. Yet our analysis suggests that they usually get it wrong. In fact, Gallup finds that companies fail to choose the candidate with the right talent for the job 82% of the time.
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1.
Hence the first 12 terms will be:
F1 = 1
F2 = 1
F3 = 2
F4 = 3
F5 = 5
F6 = 8
F7 = 13
F8 = 21
F9 = 34
F10 = 55
F11 = 89
F12 = 144
The 12th term, F12, is the first term to contain three digits.
What is the first term in the Fibonacci sequence to contain 1000 digits?
deffib():count=2a=1b=1test=1whileTrue:count+=1test=a+biflen(str(test))==1000:returncounta=bb=testresult=fib()print"The first term in the Fibonacci sequence to contain 1000 digits is: %r"%result
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210
What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
importsysimportitertoolsx=list(itertools.permutations(range(10),10))y=x[999999]total=''foriiny:total+=str(i)print"The millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 is: %s"%total
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
A number n is called deficient if the sum of its proper divisors is less than n and it is called abundant if this sum exceeds n.
As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.
Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
importsys#if len(sys.argv) == 1:
# sys.exit('Usage: ./%s integer' % sys.argv[0])
deffindDivisors(x):div=[1]foriteminrange(2,x/2+1):ifx%item==0:div.append(item)returndiv#print sum(findDivisors(int(sys.argv[1])))
# deficient and abundant
# Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.
# Integers above 28123
total=0head=28123count=1abundant=[]add=[]whilehead>count:ifsum(findDivisors(count))>count:abundant.append(count)count+=1ab_copy=abundantfornum,iteminenumerate(abundant):forsecondinab_copy:add.append(item+second)printsum(set(range(1,head+1))-set(add))
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.
For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 × 53 = 49714.
What is the total of all the name scores in the file?
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n).
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b are called amicable numbers.
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
Evaluate the sum of all the amicable numbers under 10000.
importtime,sysarg=int(sys.argv[1])total=0group=[]defproper(n):"""Return the sum of all proper numbers divisible in 'n'"""x=[1.0]i=2.0whilei<n:ifn%i==0:x.append(i)i+=1.0else:i+=1.0returnsum(x)result=proper(arg)forxinrange(0,arg+1):result=proper(x)ifproper(result)==xandresult!=x:group.append(result)group.append(x)foreachinset(group):total+=each
…so they’ve become uninformed, inept, political buffoons who own teams, products, or processes not because they are qualified, but because someone long ago (and long gone) decided they should.
To keep the formatting for your notes the same accross all installs of NV you will need to turn on ‘soft tabs’ (converts tabs to spaces) as well as setting a ‘fixed width’ font.
This is due to Simplenote defaulting to stripping out tab’s in favour of soft tabs.
And the geeks just shake their heads at the inevitable.
“There is NO way one can actually write good requirements, IMHO, if they still don’t write code,”
But judging by yesterday morning’s congressional hearing on healthcare.gov’s problems — where the website was compared to a house, a car’s engine, and scrambled eggs — a tech culture upgrade is needed throughout the capital.
"You can't make headway without thinking about a problem for a long time, in collaboration with smart researchers from different fields, as well as reading a lot," says epidemiologist Caroline Buckee, one of CNN's 10 Thinkers for 2013. "But sometimes that hard work reaches fruition or comes together at a random time once you have let thoughts settle down."
With the Ed Snowden files still being released it is plain for all to see that the fundamental stacks of interdependent Internet security protocols have been underminded and compromised.
How would you like to pay for your privacy and freedom now?
Those who can, do; those who can't, teach. - George Bernard Shaw's Man and Superman
What I cannot create, I do not understand. - Richard Feynman
If it's a core business function – do it yourself, no matter what. - Joel Spolsky
Make sure to use the NOOBS version to start with. It will let you install Raspbian (which is what you should stick with).
Then DEFINITELY change the /boot/config.txt via ‘hold shift’ on reboot or (better still) run sudo raspi-config and edit the config file manually with the guide from http://elinux.org/RPiconfig.
Dwarfs standing on the shoulders of giants (Latin: nanos gigantum humeris insidentes) is a Western metaphor with a contemporary interpretation meaning "one who discovers by building on previous discoveries". [https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants](https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants)
Create a Linux LiveUSB. You can boot it off almost any computer lying around and then rather than installing it to the computer you just booted it on, you can install it to a SECOND USB stick.
This will then let you create a USB stick that is persistent (your files are stored on there like a ‘normal’ computer) and encrypted (doesn’t matter if you lose it because you’ve got your directory syncronised via S3/Dropbox/SpiderOak right?).
There are so many links online to dodgy documentation that I should add my own but the exact details change so quickly that you’re better off asking for advice in IRC. Try http://webchat.freenode.net/ and channel #linux
90% of all large fish have disappeared since 1950s - Nature 2003
Earths ocean empty by 2048 - Science 2006
"So long and thanks for all the fish" - Douglas Adams 1984
Most people are aware that the oceans aren’t doing so well, but what is going on exactly?
Losing Nemo is a six-minute, 3D-animated film about the state of the oceans.
The film is the result of months of work by a group of creatives from around the world. They worked on it in between projects that pay the rent. It is our message to the world that we are serious about applying our art to contribute to a better world ;-)
The with statement in Python allows you to open and manipulate a file and it will take care of closing it for you.
Very handy stuff.
gyaresu@shadowrun:~/programming/projects/violent python|⇒ echo "blah stuff wooble" > thing.txt
gyaresu@shadowrun:~/programming/projects/violent python|⇒ ipython
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
Type "copyright", "credits" or "license" for more information.
IPython 1.0.dev -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: file = open("thing.txt")
In [2]: data = file.read()
In [3]: print data
blah stuff wooble
In [4]: file.close()
In [5]: with open("thing.txt") as file:
...: data = file.read()
...: print data
...:
blah stuff wooble
In [6]: data2 = file.read()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-6-6dc93a98dd0a> in <module>()
----> 1 data2 = file.read()
ValueError: I/O operation on closed file
In [7]:
"Don't savvy me." New shorthand: only 14 characters. It means: Stop dismissing valid questions with the insider's, "and this surprises you?". Jay Rosen (<a href="https://twitter.com/jayrosen_nyu">@jayrosen_nyu</a>) June 12, 2013
I did Linux-on-the-desktop for years and years, before I finally got bored of the constant round of customisation, kernel recompilation, drivers and things just-not-quite-working, and made the shift to OS X. I’ve never regretted it! [http://paul.tweedy.usesthis.com/](http://paul.tweedy.usesthis.com/)
So I’ve been playing with R(the software environment for statistical computing and graphics) this week as well as trying to learn C and I’ve been thinking about fun, real-world data/stuff to work with. Which of course leads to sets of data for R and programmable IC (Integrated Circuits) such as the ones found on development boards like the Raspberry Pi or
Arduino or BeagleBoard etc.
I discovered Field Programmable Gate Array and now just need a reason to order a Breadboard. Wifi enabled motion detection system for the meeting rooms at work (they’re always booked and seldom used). Dunno.
While reading up on programming chips I found out that a common way for computers to deal with subtraction using addition!
5678
- 3493 <- You want to subtract 3493 from 5678.
----
5678
+ 6506 <- Get each digit that you're trying to subtract up to 9: 3 needs 6, 4 needs 5, 9 is already there so 0, 3 needs 6. = 6506
----
12184
-10000 <- Remove the trailing 1 (no actual subtraction required)
====
2184
+1 <- Add 1 to complete the magic!
====
2185
The R software environment for statistical computing and graphics is AWESOME.
There’s just nothing quite like the feeling of writing code in a new environment and having a freaking chart just magically pop up on your screen. Wheeeeeeeeee!
Much more to follow me thinks. So many applications to play with interesting data.
Chain INPUT (policy DROP 1490 packets, 286K bytes)
pkts bytes target prot opt in out source destination
169 1386K ACCEPT all -- lo any anywhere anywhere
1425 114K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
2 128 ACCEPT tcp -- any any anywhere anywhere tcp dpt:ssh
4 256 ACCEPT icmp -- any any anywhere anywhere icmp echo-request
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1252 packets, 1637K bytes)
pkts bytes target prot opt in out source destination
Dump the rules to standard out:
[root@zaphod ~]# iptables-save
# Generated by iptables-save v1.4.7 on Sat Jan 19 12:58:12 2013
*filter
:INPUT DROP [1645:320384]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1277:1647869]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
COMMIT
# Completed on Sat Jan 19 12:58:12 2013
To save your settings to a file (usefull to import on other systems if your rules are complex):
So if you want to remove hashes from the start of a section of lines, in vim normal mode hit CTRL-v and then just use direction keys to select the area you want to remove.
With a default minimum install of Redhat Enterprise Linux (RHEL) or RHEL without the logos and price tag one gets a very crummy version of vi. Really nasty. And then even when you yum install -y vim and get vim-enhanced then you still have /bin/vi.
Nasty.
So I went looking for a solution.
This one sorts it for all users. And no you don’t just want to put an alias in your .bashr/.zshrc because there’s all sorts of programmes that don’t reference those configs.
Change the default /etc/profile.d/vim.sh from this:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ]; then
[ -x /usr/bin/id ] || return
[ `/usr/bin/id -u` -le 100 ] && return
# for bash and zsh, only if no alias is already set
alias vi >/dev/null 2>&1 || alias vi=vim
fi
to this:
if [ -n "$BASH_VERSION" -o -n "$KSH_VERSION" -o -n "$ZSH_VERSION" ];then
if [ -f /usr/bin/vim ]; then
alias vi='vim'
fi
fi
I agree with almost all of this except perhaps the bit about keys. I freaking love the way all app preferences share key combinations.
“Should you dump Linux and join me in darkness? How the hell should I know? :-) I’m just sharing my two cents - if you’re happy using Linux you should definitely stick with it. Obviously I wasn’t and there weren’t that many alternatives lying around.”
The benefit of the perl version is that it’s not just lines where the first character is a hash but even indented lines whos first character is a hash.
I did indeed install the package from the MySQL site.
I wanted to leave my project folders where they live normally in ~/programming/projects/ which meant I had to enable:
Include /private/etc/apache2/extra/httpd-userdir.conf
in /etc/apache2/httpd.conf and create the file /etc/apache2/users/gyaresu.conf to which I added:
<Directory "/Users/gyaresu/programming/projects/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Of course I want multiple websites which of course means Name Based Virtual Hosts so I just added some entries to /etc/apache2/extra/httpd-vhosts.conf like:
I love vim but I’d forgotten to add this snippet to my ~/.vimrc.
When you /search for something in vim it stays highlighted which can get frustrating fast.
Easy way to turn it off, just remap the space bar. Search terms will stay highlighted after a search and let you navigate around but if you want to unhighlight then the space bar will fix it.
Voila!
" Map SPACE to remove search highlighting
nmap <SPACE> <SPACE>:noh<CR>
First: Use a file. In this case I simply run tail -f (follow) on a one line script called prompt.sh.
Then background the process CTRL-Z.
Now delete the file and list the open files belonging to tail: lsof -c tail.
Notice that the PID (Process ID) is 4826 and the FD (File Descriptor) is 3r.
The 3 is the kernel auto-incrementing the FD number and the r is for read mode.
Interestingly the kernel starts from 3 because you’ll notice 0-2 are taken.
0u /dev/pts/0 # standard in
1u /dev/pts/0 # standard out
2u /dev/pts/0 # standard error
Available modes to open a file:
r = read access
w = write access
u = read and write access
space if mode unknown and no lock character follows
`-’ if mode unknown and lock character follows
And now we can see that the file descriptor is still there but (deleted).
Now that you know which file descriptor it is you can simply make a copy. Either putting it back as the original file name or something different.
` “when I’m hiring someone, I look for an applicant that fits the culture, who is bright, and who is excited and wants to learn. That’s it. I’m not going to require that they come with prior experience in every component of our stack. Anyone who wants to learn can pick that up on the job.”`
The following is a message I got today on Facebook. You really should read this book.
I read the unnatural history of the sea you advised. It's seriously changed my life. The fish I eat, the things I do, buy and the causes I support. Also I think I'm a better and more appreciative diver. Great advice. I salute you.
I've since past the book on and bought 2 more.
Made 18 films
Had two children
Co-invented the frequency-hopping spread-spectrum communication system used now in such technology as Bluetooth, Wi-Fi and CDMA
It doesn’t seem right to be too informal or glib in a resumé or job appliction. Maybe it’ll be ok to just link to this post? We’ll see. [1]
I’m writing this because I don’t have the benefit of ‘word of mouth’ that I used to benefit from. Writing about one’s attributes feels so terribly narcissistic.
LOOK AT ME! I’M AWESOME! etc.
The fundamental cause of trouble in the world today is that the stupid are cocksure while the intelligent are full of doubt.
– Bertrand Russell
I started my on-site computer business in 2002 after 6 months of learning to use a computer.
Whilst in Sydney I’d been given an old ACER laptop with a P2 CPU & 32MB of RAM. That’s what I had to work with.
When I landed back in Launceston it was just before the 2002 Elections so I started running the campaign office for the Tasmanian Greens (something I’ve done since my 20’s).
I’d turn up every day and talk to people about politics in between messing with this Windows 98 laptop.
A week or so into this Ray walked in and so began a geeky friendship and lots of foot bag.
The great way Ray had of teaching me about computers was to literally ignore all ridiculous questions and only answer the ones that showed independent research.
It’s exactly the behaviour you’ll find on IRC still to this day.
Computers are amazing. The internet is amazing. Seriously. MIND BLOWN.
Ever since then I’ve been able to learn and research and ask and help and interact on so many levels about so much AMAZING information.
I started my business so quickly after learning to use computers for two reasons. First and foremost was that I wanted a job. Second was because I seriously thought I could help enough to be worth paying.
I rang all the on-site computer businesses in town and found the cheapest hourly rate was AU$28.50. So that’s what I decided to charge. I also vowed to not charge should I be unable to help a client.
As with any business plan one should always plan for the worst and expect the best. I wasn’t disappointed. I quickly found that I could solve every problem presented to me and because I’m a big friendly happy and helpful person, I could communicate the ‘why’ something needed to be done.
Being fully informed and solving their problems meant that over the years my clients wouldn’t even want to know the options, ‘just do what you think is best’.
So I’d get all these referrals for work and even other computer businesses would either contact or recommend me for obscure stuff.
I became the Linux guy, and the OS X guy and the wireless networking guy and the BSD guy and the guy who figured out how to drive the programme of a whole range of bizarre, ancient, multi-tonne CNC machines.
GOOD FUN.
My hourly rate went from $28.50 > $50 > $55 > $75 > $100 > $110 > $150 over about four years. That’s not even including some of the cool places I’ve been flown to by the Government for remote work. Can you say junket? Sweeeet.
Oddly, clients are easier to deal with the more you charge. Not because they’re better people but because value for money is counter-intuitive. Clients paying $150/hr believe they are getting the best and will therefore trust you know what you’re doing. Which of course means that when one is doing charity work (as I was want to do) that you will be constantly questioned over your decisions and skills. Because obviously if you’re charging either nothing or very little then you’re value is the
equivalent. Bizarre but true.
This period of my life was the longest spent in any one place. I was comfortable in my job but itching to see more of the world. So I sold my business. While travelling in Queensland I went out to the Great Barrier Reef on a boat with 300 hundred other people. Two years later after an apprenticeship and a LOT of excellent training from people I still greatly respect I was a senior diver, running that boat and teaching at a dozen sites in Fiji.
I’ve taken a few thousand people diving and taught people who are now instructors themselves. 13hrs/day 7 days a week (with the occasional weekend off).
BECAUSE I’M PASSIONATE.
That’s it really. Passion. I want you to know I’m passionate.
Work is a time trade-off for money. I carry no debt and live frugally enough that I never have to stay in a bad situation. That’s freedom. It also means I have the luxury of being honest. I want to get up in the morning and do things that matter. I also want to keep learning. It’s scary and frustrating and exciting but being completely ignorant of a topic makes for a fantastic rush of learning.
I’m currently contracting to work remotely on Linux servers. I can still keep doing that (hey, the money’s great) but I’d like to work with others on something special.
So if you’d like a friendly hard working passionate man to join your organisation. Please feel free to contact me.
Gareth
[1] I’ve also found it infuriating to read job postings. They are just so full of BS.
help - Displays all of the help commands that raaarbot knows about.
help <query> - Displays all help commands that match <query>.
raaarbot <anything related to size, speed, quality, specific body parts> - raaarbot will "that's what she said" that ish
image me <query> - The Original. Queries Google Images for <query> and
knowing is half the battle - display "The Battle" image
map me <query> - Returns a map view of the area returned by `query`.
math me <expression> - Calculate the given expression.
mustache me <url> - Adds a mustache to the specified URL.
mustache me <query> - Searches Google Images for the specified query and
pug bomb N - get N pugs
pug me - Receive a pug
script info <script> - Print script help
script list [-l] - List all availiable scripts (optional -l for list mode)
script load <script> - Load a script
ship it - Display a motivation squirrel
show storage - Display the contents that are persisted in redis
show users - Display all users that raaarbot knows about
sosearch me <query> - Search for the query
sosearch me <query> with tags <tag list sperated by ,> - Search for the query limit to given tags
task add <task> - Add a task
task delete <task number> - Delete a task
task list tasks - List the tasks
translate me <phrase> - Searches for a translation for the <phrase> and then
translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
who is <user> - see what roles a user has
wiki me <query> - Searches for <query> on Wikipedia.
xkcd - The latest XKCD comic
xkcd <num> - XKCD comic matching the supplied number
youtube me <query> - Searches YouTube for the query and returns the video
I’ve been teaching myself JavaScript and Python for the last six months and thought now was a good time to open up my private repository hosted on GitHub.
I’ve started with a fresh repo as my original private repo had too many keys & mess in it.
Well I was.. Until I found out that my changes to the Jekyll template file weren’t getting updated on http://gyaresu.github.com
So now I need to wade back into the Jekyll code and figure out what it actually does when it’s generating the static content.
I mean, the local version works fine. It’s only relying on the Github server to re-run the config and generate new static code from the templates based on the new config.
INCLUDES DOWNLOAD OF THE FULL FLOEX CATALOGUE WITH THE PURCHASE OF THE T-SHIRT (ZORYA, POCUSTONE, MACHINARIUM OST, SAMOROST II OST) AND ONE SPECIAL UNRELEASED BONUS TRACK!!! FREE DOWNLOAD CODES WILL BE SENT TO YOU BY E-MAIL, BONUS TRACK IMMEDIATELY.
Because it should always matter. And when it doesn’t then it’s time to do something else.
Hello
I would like to send a huge thank you to all of the staff of Seaflight on Monday 30th May who went to so much effort to make sure we all had a great time.
I boarded the boat with no intention of scuba diving in my life, let alone that day! But the crew knew that most of that fear comes from misunderstanding what is involved. I had never successfully used snorkel gear before and didn’t like being in the sea much. I was curious though when I saw the staff members demonstrating diving equipment about what it would feel like to wear diving gear and stick my head under the water so when I found out I could get my money back if I didn’t like it, I was ready to consider it as I figured I had nothing to lose. I have problems with anxiety so I thought I’d never find anybody willing to take me diving. But I explained this to Gareth who was understanding and said he’d take me diving himself at my own pace.
I was amazed at how quickly they got us into the water, but I didn’t feel the pressure of having to pretend not to be scared, which was great. The crew laughed and joked, which put me at ease. Gareth was happy to hold my hand the whole time which helped because I didn’t have to worry about getting lost. When I felt confident enough to swim on my own, he showed me interesting fish and stayed close by. When I left the water half an hour later, I felt completely different about the ocean. I love watching fish in aquariums so it was great to get to meet them up close and I got to be part of a world I never thought I would see. I don’t think I’m going to dive on a regular basis but just knowing that I can do it if I want to is amazing. I felt my confidence boosted massively.
Later in the day I had a go at snorkelling, which seemed simple after scuba diving. I did have some problems with using the mask but the crew were quick to help and one of them even got into the water to help me use it properly. I saw amazing fish. I snorkelled on the Camira trip today and now feel confident enough to snorkel more in future.
I boarded the boat knowing nobody and left it knowing pretty much everybody and with some new friends.
I’m a pretty sceptical person usually and I don’t tend to believe all the clicheed quotes in brochures but you can take this from me: it was a life-changing and life affirming experience that I will remember for the rest of my life and probably the best day of my 3 month trip.
Please pass on my thanks to Gareth and the rest of the team.
The Cat and the Baboon
The Migrating Warblers
The Squirrel and the Chipmunk
The Toad, The Turtle, and the Duck
The Motherless Bear
The Mouse and the Snake
The Parenting Storks
The Faithful Setter
The Crow and the Lamb
The Sick Rat and the Healthy Rat
The Cow and the Turkey
The Vigilant Rabbit
The Judicious Brown Chicken
The Parrot and the Potbellied Pig
Hello Kitty
The Grieving Owl
“Being persuaded to spend money we don’t have on things we don’t need to create impressions that won’t last on people we don’t care about.” - Tim Jackson
I’ve been installing software and tweaking my main site via the iPhone today. I’m using a bunch of plugins for Wordpress and a couple of iPhone apps to assist me in controlling my content creation.
Mainly I just don’t want to directly submit any more of my life through places like Facebook and Twitter where I don’t even get to own it. I’m ok for now submitting still to these ‘free’ services but only until I figure out a complimentary system.
I got screwed by Apple today. Seems like my new laptop hadn’t really shipped a week ago like they said. Apparently next week for sure! Muppets.
Till then only as many experiments as I can be bothered with on this little screen.
Don’t even get me started on doing any real work via iPhone touch screen.
I’ve been thinking a lot as usual about our future and the very different lives we lead as a result of technology.
We are not controlling our online lives. Just try accessing your old Facebook or Twitter posts.
Most people won’t change their current ways until there’s a reason to.
I endeavor to beat a path for others to follow. I know from the outset I’m not alone in this and I hope there will be critical mass to move away from these gilden cages.
DNS (Domain Name System) is one of those truly wonderful chunks of knowledge that you can get away with outsourcing but in the end you really need to know wtf is going on.
I have a soft spot for DNS. I know that I don’t know enough and yet I know more than most.
It’s a wonderful place to focus your knowledge. Especially with IPV6 coming along while gazzilions of admins around the world chant the chorus to “la la la la la la la la la la la la” with fingers firmly stuck in ears.
It’s the glue of the internet. There really no way around it.
You may drive one of a thousand cars on the internet highway. TCP/UDP implementations of JSON/HTML/XML/SQL/BLAHBLAHBLAH but DNS tells everyone where to go.
Here’s to you DNS. WIth your spoofing and your new found vulns you still rock my world.
Well I’m still living out of a backpack and the ideas of what to do with my life are starting to mount up.
What a strange position to be in. I have a couple of businesses that tick over and only require me to work from the interwebs. So now I’m physically free but can’t decide where it is I should put my person.
Peru and their AU$130/month iphone plans with unlimited data?
Australia in a campervan?
London and Linux sysadmin?
Well I was quite looking forward to Amsterdam and Greenpeace sysadmin but UK Passport office helpline for passports #fail means UK passport in 12 months. I’ll have another chat with Greenpeace then perhaps.
What to do till then?
Christof Rehage has an amazing youtube clip that is a must-see http://www.thelongestway.com
That’s given me the inspiration to think about walking up the eastern seaboard of Australia. I could work and walk, losing some desperately unwanted kilos.
Will walking be so much different to driving. I know the coastal route of Australia pretty well in that lazy hop-to-hop next-pretty-place kind of way. Have laptop will travel?
Do I need to get a cart built? What about charging camera/laptop/iphone?
Should I be doing this in Europe, South America, China, South East Asia?
Buggered if I know. Maybe something positive to do with the Copenhagen Climate summit?
iPod on my iPhone 3G was removing the audiobooks I was listening to at strange times. On sync or even just plugging in the power. So a little research found that with iTunes 8 you can select a Genre then ‘cmd + a’ » right click » options and change “Media Kind” to “Audiobook”. Tick “Remember Position” and “Skip when shuffling” » Ok.
Sorted.
Next problem was having upgraded my drive to a 500GB 7200RPM Seagate (465GB irl) the Time Machine was showing insufficent space on the external 500GB drive as it needed to backup 469GB.
Problem is that there’s only 390GB on the laptop drive. Hmmm. The internets doesn’t seem to want to help on this one either.
Solution:
Under “Options” on the Time Machine preferences panel you can click the wee “+” button and add folders or even entire drives that you don’t want TM to backup. What I discovered was that TM isn’t really sure how much stuff you have on your internal drive until it has a crack at it. Problem is it also adds a 20% buffer to its estimation. What needed to be done was add almost all of the large folders (Applications, Users) and let it have a go at backing up the few remaining ones first. This done you go back and remove all the other folders from “Do not back up:” and let it run again. Voilá!
Well apart from a dismal rushed attempt to write a resumé in 2002 I’ve gotten along just fine without needing one.
The time has come though where some of the interesting jobs I want to apply for are on the other side of the world and there’s no chance to look them in the eye and shake their hand.
Cursor movement
h - move left
j - move down
k - move up
l - move right
ctrl+f page forward
ctrl+b page backwards
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)
e - jump to end of words (punctuation considered words)
E - jump to end of words (no punctuation)
b - jump backward by words (punctuation considered words)
B - jump backward by words (no punctuation)
0 - (zero) start of line
^ - first non-blank character of line
$ - end of line
G - Go To command (prefix with number - 5G goes to line 5)
Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.
Insert Mode - Inserting/Appending text
i - start insert mode at cursor
I - insert at the beginning of the line
a - append after the cursor
A - append at the end of the line
o - open (append) blank line below current line (no need to press return)
O - open blank line above current line
ea - append at end of word
Esc - exit insert mode
Editing
r - replace a single character (does not use insert mode)
J - join line below to the current one
cc - change (replace) an entire line
cw - change (replace) to the end of word
c$ - change (replace) to the end of line
s - delete character at cursor and subsitute text
S - delete line at cursor and substitute text (same as cc)
xp - transpose two letters (delete and paste, technically)
u - undo
. - repeat last command
Marking text (visual mode)
v - start visual mode, mark lines, then do command (such as y-yank)
V - start Linewise visual mode
o - move to other end of marked area
Ctrl+v - start visual block mode
O - move to Other corner of block
aw - mark a word
ab - a () block (with braces)
aB - a {} block (with brackets)
ib - inner () block
iB - inner {} block
Esc - exit visual mode
Visual commands
shift right
< - shift left
y - yank (copy) marked text
d - delete marked text
~ - switch case
Cut and Paste
yy - yank (copy) a line
2yy - yank 2 lines
yw - yank word
y$ - yank to end of line
p - put (paste) the clipboard after cursor
P - put (paste) before cursor
dd - delete (cut) a line
dw - delete (cut) the current word
x - delete (cut) current character
Exiting
:w - write (save) the file, but don’t exit
:wq - write (save) and quit
:q - quit (fails if anything has changed)
:q! - quit and throw away changes
Search/Replace
/pattern - search for pattern
?pattern - search backward for pattern
n - repeat search in same direction
N - repeat search in opposite direction
:%s/old/new/g - replace all old with new throughout file
:%s/old/new/gc - replace all old with new throughout file with confirmations
Working with multiple files
:e filename - Edit a file in a new buffer
:bnext (or :bn) - go to next buffer
:bprev (of :bp) - go to previous buffer
:bd - delete a buffer (close a file)
:sp filename - Open a file in a new buffer and split window
ctrl+ws - Split windows
ctrl+ww - switch between windows
ctrl+wq - Quit a window
ctrl+wv - Split windows vertically
I’ve held off a month before writing you this email because I didn’t
want it to come across as a personal attack.
One of the reasons I initially chose to go with Bluehost was because
of your excellent blog.
Unfortunately there’s nothing that can change the way I feel now when
someone mentions your company (please note again, not a personal
attack).
Around the 19th March 2009 my bluehost account giantfriend.com was
closed and all data deleted without warning or even explanation.
Bluehost had always been my main hosting site (around 14 websites) and
I have a server in Sydney (I’m in Australia) for latency important
sites.
This is my business and of course all of my clients relied on DNS
email & site hosting from me.
I spent the next week after this catastrophe attempting to get the
account reinstated and all the sites back.
Although the bluehost staff are friendly and helpful there was no-one
who could tell me what the problem was that caused account deletion
and no-one could retrieve any backups at all.
I have no idea if this was a violation of the terms or a mistake or an
overzealous sysadmin. My entire account was just ‘gone’.
Needless to say I was absolutely gutted and don’t need to tell you
that there should have been some measures in place to protect from
this now apparent ‘Sword of Damocles’.
To the best of my knowledge the account was using ~5GB of data &
serving up pretty standard php/mysql based websites. There was no file
sharing or dodgy content on the server.
I include the first email I received as none of the subsequent emails
or phone calls provided any more clarity:
Dear Gareth:
Your web hosting account for giantfriend.com has been deactivated
(reason: call customer support).
Although your web site has been disabled, your data may still be available for
up to 15 days, after which it will be deleted.
If you feel this deactivation is in error, please contact customer support as
soon as possible.
Thank you,
BlueHost.Com Support
http://www.bluehost.com
For support go to http://helpdesk.bluehost.com/
Toll-Free: (888) 401-4678
Please feel free to contact me if you have any questions.
Say you’ve got your webserver listening on port 80 and all requests from your router for webpages point to it (server0).
Now say that server0 handles Name based Virtual Hosts. So the one Apache web server is hosting a whole bunch of domains: example.com example2.com example3.com etc.
What do you do if you want to run a second server (server1)on the same IP address?
Well you could have another server there just to load balance or you could get the router to do it (if it was smart enough).
But another way is to setup server0 to proxy connections of your choice over to server1.
mirror, wait 2 seconds, get all required elements, convert extensions to html, convert links to work locally, prefix folder, enable spanning across hosts when doing recursive retrieving, set domains to be followed, path to put stuff, domain.
Make sure that iTunes is not running on both Macs.
Disconnect your iPhone/iPod from both Macs.
Copy your iTunes folder.
/Users/username/Music/iTunes
Copy your iPhone/iPod backups.
/Users/username/Library/Application Support/MobileSync
Copy your iTunes configuration files.
/Users/username/Library/Preferences/com.apple.iTunes*
Open iTunes on your new Mac and verify that Applications and Ringtones appear.
Connect your iPhone/iPod to the new Mac and accept any new authorizations.
Use iTunes on your old Mac to de-authorize the computer.
“It’s not surprising, therefore, that projects tended to be behind schedule. Take a plan that’s created according to a generic formula, estimate the work in advance of any significant knowledge of requirements, have the estimates done by people who won’t be doing the work, never update the plan after work is started, and what do you get? Lousy plans… and they were treated as unquestionable truths.”
The reason you have to use
dpkg –force-confmiss is because whenever your config files () are gone, dpkg
assumes you deleted them on purpose, and that you want them to stay deleted. You can also
reinstall them using the following apt-get line: apt-get -o
DPkg::Options::="--force-confmiss" --reinstall install ; or using aptitude,
aptitude -o DPkg::Options::="--force-confmiss" reinstall ;
slave:~# gem install god
Bulk updating Gem source index for: http://gems.rubyforge.org/
Building native extensions. This could take a while…
ERROR: Error installing god:
ERROR: Failed to build gem native extension./usr/bin/ruby1.8 extconf.rb install god
extconf.rb:1:in `require’: no such file to load – mkmf (LoadError)
from extconf.rb:1
Gem files will remain installed in /var/lib/gems/1.8/gems/god-0.7.8 for inspection.
Results logged to /var/lib/gems/1.8/gems/god-0.7.8/ext/god/gem_make.out
So new house only has phone line in the kitchen. Solution: WDS using Tomato of course.
So now I have one wrt54g connecting to the net in PPPOE Bridge mode with a billion modem (meh, average modems).
And one wrt54g in my office that acts as an extension of the main one. So plug that into a switch and all the computers here in the office can connect via ethernet.
One more for the lounge and the movie/music server and I’m sorted.
The important bit is ‘force user’ and ‘force group’ otherwise your local user won’t have permissions to the shared directory.
sudo apt-get install samba
/etc/samba/smb.conf
Changes:
security = share
guest account = nobody
[stuff]
writeable = yes
path = /stuff
public = yes
guest ok = yes
guest only = yes
guest account = nobody
force user = gyaresu
force group = users
browsable = yes
So I tried the 8800GT 512MB to see whether crysis would run ‘aight. No go.
Anyway, while messing around with the card under linux I upgraded the nvidia drivers to the latest from the nvidia site (ubuntu doesn’t have them in the repos yet).
My stupid second monitor couldn’t have its stats detected (edid).
So off I go AGAIN fsck’ing around with xorg.conf and Xorg.0.log files to figure out what’s changed THIS driver release.
Anyway: The Error
root@sdf:~/x11# cat /var/log/Xorg.0.log.old |grep -i edid
(WW) NVIDIA(GPU-0): Unable to read EDID for display device DFP-1
(–) NVIDIA(0): DPI set to (90, 88); computed from “UseEdidDpi” X config
The Fix (get the edid.bin from the one working monitor under nvidia-settings, look in the GPU settings. You can save it from there.)
javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();
Browser.tabs.tabMinWidth is the Firefox configuration value that determines the tab width. Here is how to disable tab scrolling:
Type about:config into the Firefox address bar.
Find the browser.tabs.tabMinWidth key. The default value is 100.
To disable tab scrolling completely, double click on it, set the value to 0. To make more tabs fit before scrolling gets activated, set that number to 75.
I run MPD as my music player because it’s FREAKING AWESOME. It’s a daemon so you can basically connect to it any way you want: command line interface ncmpc or via your browser with Pitchfork or a GUI like Sonata.
Of course one needs one’s Last.FM submissions and fortunately MPDScribble does the job.
<edit: 2008/08/07>
I’m now using Mint Linux (currently the most useable debian based Linux imho) and MPDScribble is fubar for some unknown reason (I’ve spent days looking at it). So instead installed lastfmsubmitd to submit to last.fm & lastmp to get the info from mpd. They’ve both got lovely ncurses setup screens that asks your lastfm name/password & what group you want to run the daemon under. Brilliant.
So today I tweaked the mpd.conf to output to multiple audio streams. One to my awesome NAD C 320BEE amp & Quad 22L’s, and the other to my server running icecast2.
So now I can login to my server http://LikeI’mGoingToTellYou.org/mpd/ to access Pitchfork & http://LikeI’mGoingToTellYou.org:8000 to grab the stream.
All I have to do is grab foobar2000 and I can now listen to all of my rather extensive music collection from anywhere in the world.
It’s like taking home with me everywhere I go. Sigh I feel all gooey on the inside.
This tutorial handles about the usage of the wonderful media player MPlayer. It explains several options, lists some useful keyboard shortcuts and handles about tips and tricks that can be used to enhance your multimedia experience.
Difficulty: Basic
Note: this tutorial assumes that you have MPlayer installed & working and that you have some basic shell knowledge.
Playing a file
The most simple way of invoking MPlayer to play a media file is this:
[rechosen@localhost ~]$ mplayer
MPlayer will try to auto-detect what kind of file you’re trying to play (it usually succeeds) and play it. If it’s an audio file, it’ll just start playing and show its status and possible warnings on the command-line. If it’s a video file, it’ll open a window to play it in and then start playing.
Seeking through a file
You can seek through a file with a set of 3 keyboard shortcut pairs. Each pair makes MPlayer seek a different amount of time, and the pair consists of a key for seeking backward and a one for seeking forward. Listed below are those key pairs, for seeking backward and forward respectively:
Left arrow and Right arrow (10 seconds)
Down arrow and Up arrow (1 minute)
Page down and Page up (10 minutes)
Knowing these will come in handy a lot of times.
Playing a DVD
MPlayer does not have DVD menu support (sadly), but it does support playing DVD’s. You can play a DVD this way:
mplayer dvd://
Replace with a number, like 1, 2 or 3. I personally prefer xine for DVD playback, as xine does support DVD menus.
Playing with subtitles
You can play a movie with subtitles in multiple ways. When playing a movie file, you can specify a subtitle file this way:
[rechosen@localhost ~]$ mplayer -sub
When playing a DVD movie, you can also use the DVD’s subtitle by specifying a language code like this:
The above command would try to use dutch subtitles first, and fall back on english ones if dutch subtitles weren’t available.
Useful keyboard shortcuts
A list of useful keyboard shortcuts (sometimes called hotkeys) in MPlayer:
(note that the full list can be found in MPlayer’s man page)
“f” => Toggle between full-screen and windowed mode during video playback (you can set the option -fs on the command line to make MPlayer start playing in full-screen mode immediately)
“o” => Switch OSD (OnScreen Display) mode during video playback (for viewing how much time the movie has been playing and what its total lenght is)
“p” or Space => Pause / resume playback
“q” or Esc => Quit MPlayer (Esc does not quit but only stops playback when in GUI mode)
“/” and “” (or “9” and “0”) => Decrease / increase playback volume respectively
“m” => Mute sound (toggle)
“T” (usually Shift + “t”) => Toggle stay-on-top (very useful if you don’t want your video window to be overlapped by an other application)
“b” and “j” => Cycle through available subtitles
“x” and “z” => Adjust subtitle delay (useful if you have a subtitle that isn’t 100% synced; you can then correct the time difference on the fly)
“I” (usually Shift + “i”) => Show the filename of the movie being played (useful if you want to know that without interrupting the movie)
“1” and “2” => Adjust contrast
“3” and “4” => Adjust brightness*
“5” and “6” => Adjust hue*
“7” and “8” => Adjust saturation*
*: These do not always work; see the MPlayer man page.
Generating an index
Sometimes, video files (mainly AVI files) have a corrupted index, or no index at all. This frequently is the case with incorrectly or incompletely downloaded files. Fortunately, MPlayer can generate the index it needs to play the file correctly. By using the -idx option, you can tell MPlayer to generate an index when necessary:
[rechosen@localhost ~]$ mplayer -idx
Sometimes the file does contain an index, but a corrupted one. In those cases, you might need to force MPlayer to generate an index:
[rechosen@localhost ~]$ mplayer -forceidx
Generating an index can take some time, depending on the size of the video file, but after that, the file should play correctly.
Correcting bad audio/video sync
Some videos (mainly flv files) are encoded in a horrible way, and MPlayer will have enormous trouble with the A/V (Audio/Video) sync. There are pretty much two possibilities in this case:
MPlayer is trying to fix it but the sync is worsening too fast
MPlayer is trying to fix something that’s already right and therefore pushes the sync away unnecessarily
In the first case, you should allow MPlayer to try harder to fix the sync:
In the second case, you shouldn’t allow MPlayer to fix anything when it comes to the sync:
[rechosen@localhost ~]$ mplayer -autosync 0 -mc 0
You might wonder what those options mean. Well, setting autosync to a positive value allows MPlayer to gradually adapt its A/V correction algorithm. The higher the value, the faster MPlayer will try to correct it. The mc option specifies how many seconds MPlayer may correct every frame. Setting it to a high value (like 2.0) practically allows MPlayer to do whatever it thinks it should to correct the A/V sync. Setting it to 0 stops MPlayer from trying anything when it comes to syncing.
Using MPlayer on slow systems
As video playback is a CPU-intensive task, older and slower systems may have a hard time to play certain video files. MPlayer has a feature that will help them to keep up the playback with less CPU power: -framedrop. This will allow MPlayer not to render a frame here and there if the CPU can’t handle it. On systems that are far too slow, it won’t be a pleasure to “watch” the movie (the majority of the frames will just not be rendered at all), but on systems that are a bit faster, this will stop the playback from having hiccups here and there. You can use the -framedrop option like this:
[rechosen@localhost ~]$ mplayer -framedrop
Also, when trying to play MP3 or OGG Vorbis files, you might (on really slow systems) experience buffer underruns, spoiling your music experience. In that case, try using the libmad (in the case of an MP3) or the Tremor (in case of an OGG Vorbis) audio codec. You can detect whether you have a one or not like this:
(In case of MP3)
[rechosen@localhost ~]$ mplayer -ac help | grep mad
If the above command returns a line like this:
mad libmad working libMAD MPEG layer 1-2-3 [libmad]
Then you can play an MP3 file with libmad, which uses a lot less CPU power. To do so, invoke MPlayer like this:
[rechosen@localhost ~]$ mplayer -ac mad
In OGG's case, you can use the same trick to look if you have a tremor audio codec available:
[rechosen@localhost ~]$ mplayer -ac help
grep tremor
Sadly, I don’t have an example of what it should look like. If you seem to have a working tremor decoder, please leave a comment here so I can add it.
Playing streams from the internet
Many web radio stations make you download a playlist with different ip’s and ports if you want to listen to them. MPlayer is perfectly able to play a web station stream, but the playlist is not a stream, nor a media file. If MPlayer doesn’t autodetect that it’s looking at a playlist and not at a direct stream or media file, you can try using the -playlist option:
[rechosen@localhost ~]$ mplayer -playlist
And if the server has hiccups and causes a lot of buffer underruns (or if you have a bad connection), you can set a bigger cache size:
[rechosen@localhost ~]$ mplayer -cache 8192 -playlist
The cache size is specified in kilobytes; the above will make MPlayer use a cache of 8 mb. Note that MPlayer doesn't fill the whole cache before it starts playing, it only fills about 4 percent (after that it'll try to keep filling the cache during playback). You can alter that percentage with the -cache-min option:
You can seek in a cache, but do not expect too much of it =).
Looping playback
If you want the media file you’re playing to loop a certain amount of times (or infinitely), you can specify the -loop option, like this:
[rechosen@localhost ~]$ mplayer -loop 3
The above command will play three times and then exit.
[rechosen@localhost ~]$ mplayer -loop 0
The above command will repeat playing forever, unless it is interrupted (for example by quitting MPlayer with the "q" keyboard shortcut). Infinite playback can be useful if you, for example, want a (promotion) movie to play all day on an exhibition.
Altering the playback speed
This may not be that useful, but it can be good for a laugh =). You can make MPlayer play a media file at a different speed with the -speed option. The value 1.0 means normal speed, 0.5 means twice as slow, 2.0 means twice as fast and so on. Specify the option like this:
[rechosen@localhost ~]$ mplayer -speed 2.0
Altering the sample rate
You might want to alter the output sample rate sometimes (certain audio cards, for example, do not support other samplerates than, say, 48000 Hz). This is done with the -srate option, like this:
[rechosen@localhost ~]$ mplayer -srate 48000
This can also be useful when exporting audio to a file (see next chapter).
Exporting the audio to a wav file
You can export the audio of a video file to a wav file this way (note that you can also use this to convert an audio file to a wav file):
[rechosen@localhost ~]$ mplayer -ao pcm
This will export the audio to the file audiodump.wav. You can also specify a filename for the exported wav:
[rechosen@localhost ~]$ mplayer -ao pcm:file=.wav
Watching a movie in ASCII
Another pretty useless but funny feature. There are two libraries that provide support for this: aa and caca. With libaa, you can only watch a movie in black & white ASCII, while libcaca supports colors. However, libaa is more widely supported. You can watch a movie with libaa this way:
[rechosen@localhost ~]$ mplayer -vo aa
And, if you want to (and can) use libcaca:
[rechosen@localhost ~]$ mplayer -vo caca
Exporting a movie to a lot of pictures
MPlayer can also export a movie to a load of images. For example:
[rechosen@localhost ~]$ mplayer -vo jpeg
Warning: the above command will output a huge amount of jpeg files. I strongly recommend to do this in a freshly made, empty directory created for this purpose.
The filenames of the jpeg file it will export will look like this:
00000001.jpg
00000002.jpg
00000003.jpg
And so on…
You can export to some other formats. Just replace jpeg in the command above with ppm, png or tga. Note that all these image format have their own options, too. Look for them in MPlayer’s man page.
Specifying an aspect ratio
When playing video files on, for example, a wide laptop screen, you’ll probably want to benefit from that wideness by watching a movie in a 16:9 aspect ratio. You can do that this way:
[rechosen@localhost ~]$ mplayer -aspect 16:9
Of course, you can also specify 4:3 as the ratio to force MPlayer to show the movie in non widescreen format.
Putting options in your MPlayer config file
MPlayer has a nice way of storing options so they will be automatically set every time you invoke the MPlayer command. This can be useful if your system, for example, always needs the audio outputted with a different samplerate. However, the syntax of the config file is a little different. If you’d type -srate 48000 on the command-line, this should be specified in the config file as srate=48000. More complex options, like the -ao pcm:file=.wav, should be put between quotes in a way like this: ao="pcm:file=.wav". The config file is located at ~/.mplayer/config for a user, and a global configuration file is located at /etc/mplayer/config. The different values are separated by newlines, like this:
“This works great !!! Good for when all your family is together. The best part is that no one has to wait for their special omlette and no frying! Have guests write their name on a quart-size Ziploc freezer bag with permanent marker. Crack 2 eggs (large or extra-large) into the bag (not more than 2) shake to combine them. Put out a variety of ingredients such as: cheeses, ham, onion, green pepper, tomato, hash browns, salsa, etc. Each guest adds prepared ingredients of choice to their bag and shake. Make sure to get the air out of the bag and zip it up. Place the bags into rolling, boiling water for exactly 13 minutes. You can usually cook 6-8 omelets in a large pot. For more, make another pot of boiling water. Open the bags and the omlette will roll out easily. Be prepared for everyone to be amazed. Nice to serve with fresh fruit and coffee cake; everyone gets involved in the process and a great conversation piece.
Imagine having these ready the night before, and putting the bag in boiling water while you get ready. And in 13 minutes, you got a nice omlette for a quick breakfast!!!
I used tomatoes, ham, green onions, cheddar cheese and mushrooms in this one! MMMMMMMM . . .MMMMMMM good!!!”
You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user b to Host B / user b. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.
How to do it
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory ‘/home/a/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):
a@A:~> ssh b@localhost mkdir -p .ssh
b@localhost’s password:
Finally append a’s new public key to b@B:.ssh/authorized_keys and enter b’s password one last time:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B ‘cat » .ssh/authorized_keys’
b@B’s password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B hostname B