Link:
https://dannyman.toldme.com/2010/05/28/ubuntu-linux-add-swap-file-at-boot/
A while back I outfitted my personal workstation with 4GB of RAM. That’s plenty of memory and since disk space was tight I didn’t want to waste any on a swap partition, and I lived happily without swap for a very long time until I began using more virtualization. (I freed up space on my physical desk top by migrating my work environment from a laptop to a virtual machine on my personal workstation.)
I wrote a script to add a “temporary” swap file on demand but what I wanted was a swap file at boot. That actually turns out to be pretty simple. In this case, I just prepare the swap file:
FILE=/mnt/swapfile
SIZE=8388608 # 8 GB
dd if=/dev/zero of=$FILE bs=1024 count=$SIZE
mkswap $FILE $SIZE
swapon $FILE
swapon -s
Then, to make it stick, add this line to /etc/fstab
just as you would for a swap partition:
/mnt/swapfile none swap sw 0 0
This is a win for the Unix everything-is-a-file philosophy.
See Also: Ubuntu Community Swap FAQ
3 Comments
Link:
https://dannyman.toldme.com/2010/05/30/a-brief-history-of-the-banjo/
The banjo came from Africa. White people began playing banjo in the 19th century in Minstrel Shows. As white people in black face got better at playing the banjo, black people lost interest.
. . .
Mei was called in to substitute at the hospital. Left without any better ideas of how to spend my day I hopped on the train, transferring to the 7 at Times Square, figuring that I might as well cover the IRT system. Once it hit Queens, a borough I haven’t visited since moving to New York except to fly through the airports, we rode on elevated tracks. At one point the elevated tracks were double-stacked, which thrilled me and I thought “only in New York . . .”
I hopped off at Woodside 61st St to admire the LIRR overpass. I then rode two more stops up to 74th St Broadway thinking I might transfer to the trains running out to Jamaica, then take some complicated set of transfers back, but first I had to explore the neighborhood, which began Indian, everyone offering a $12 lunch buffet, though I wasn’t hungry. A bit further and I saw some stoop sales and a sign advertizing a Flea Market, but what I found were many people milling around a board with lots of spread sheets posted, each spreadsheet headed by “Mesa” and a number. At first I figured this was table assignments for the flea market, or maybe a silent auction. I got closer and saw that the spreadsheets were tallying rows of numbers in the tens of thousands. I am used to wandering in foreign countries where I don’t speak enough to ask intelligent questions so my natural instinct was to wonder to myself and continue my wander.
People were standing around filling out forms on clipboards. Others carried red, yellow and blue flags. “Venezuela?” I wondered. No, Venezuela has stars. Finally campaign posters and small groups chanting for their candidate. I caught the name Columbia, and at last understood that people were campaigning for mail-in ballots.
I wandered back around, passing a lady who was selling meat kabobs from a grill set on a grocery cart beneath the elevated tracks. I was tempted, because the last street vendor of this nature I had seen was nearly a decade ago, in Bangkok. I was glad that New York had enough people from developing countries that someone had balls enough to (I assume) flout the authorities and sell some proper street food.
Back at the station I reconsidered my plan: the other trains ran underground, how far I did not now. There were also multiple service advisories: shuttle buses to Jamaica? Nah, I took the 7 to the end of the line: Flushing.
The Flushing station gave very much the impression of a transit outpost: plenty of people ride to the end of the line, and pass past a dozen signs indicating which buses connect nearby, then they go stand in long lines on the street to head, I assume, home. Also, everyone is Chinese. And many signs are posted in Chinese, without translation.
I wandered in the commercial bubble surrounding Flushing Main St, wandering into “malls” of little stalls. I didn’t buy anything, but I recalled that Mei’s parents had declared San Francisco Chinatown superior to the one in Manhattan, which was too cheesy. There was little dairy for sale in Flushing: just Chinese people selling goods and services to Chinese people. There was no self-consciousness of outsiders. I saw a man hold a little boy over a street curb so he could urinate in the gutter, as I thought to myself “there must be a toilet he could use.” In the basement level of one mall I caught sight of an ancient man sitting in a stall impassively watching a porno. The video screen was angled away from me but I could see what was on the screen. I smiled: people were being human and that was all there was to say.
Feedback Welcome