All hail the lumbersexual

Take one flannel shirt, one Mike Napoli beard circa October 2013, mix in an iphone 6 and some workboots, then add an overpolished axe and flavor with homebrewed craft beer and you’ve got the latest lifestyle fashion trend for men: the “Lumbersexual”.

You think I’m making this up. But go ahead, Google it. I dare you. Unless you’re somewhere in the vicinity of PyongYang, your friendly neighborhood Interweb will bring you the full monty search results, from GearJunkie and Gawker, Buzzfeed and Jezebel, The Atlantic and Time, and even Cosmo (“Are You Dating a Lumbersexual?”).

Buzzfeed plunge-cuts to the heartwood, defining the breed: “Wood. Nature. Beard. Leather, denim, plaid and flannel. These are the cornerstones of lumbersexual men.”

And apparently not just any denim. Selvedge denim, woven using old-fashioned techniques on antique looms.

Think Brawny paper towels and Paul Bunyan.

Cosmo tells us more: “In the early 2000s everyone was buzzing about metrosexual guys. You know, the guy who didn’t have to borrow your eye cream because he owned a whole medicine cabinet full of his own. Well, that guy has now slapped on a flannel and is probably chopping down a tree in a forest while smelling like 1950s pine trees and he’s being called a Lumbersexual.”

I’ll have to ask someone slightly older than me what pine trees smelled like in the 1950s and exactly how their scent differed from today’s king of the forest. Better-perfumed, I presume? Alas, the spicy aroma of Cold-War pine is apparently another casualty of climate change. Maybe if we call it “Selvedge Pine” and hand-fell it with a two-man cross-cut we could sell it for a couple thousand bucks a board foot.

What started this trend? Did Oprah appear in public in plaid? Was it Scott Brown tweeting selfies from his pick-up truck? Did Tom Brady buy a Tree Farm? Has Bieber gone Carhartt?

GearJunkie’s Tom Puzak attempts to explain: “Whether the roots of the lumbersexual are a cultural shift toward environmentalism, rebellion against the grind of 9-5 office jobs, or simply recognition that outdoor gear is just more comfortable, functional and durable, the Lumbersexual is on the rise.”

Used to be that all you had to do to signal your rugged, rural mansomeness was to drive a truck and know what 4WD means. And it didn’t even have to be a pick-up—an SUV would do the trick, for what’s not manly about “Sport”, “Utility”, and “Vehicle”? But then soccer moms exchanged mini-vans for Ford Expeditions and SUVs became “sport-utes”. By the time Porsche and BMW started making SUVs, it was all over. More is demanded of the manly men.

As it turns out, the Lumbersexual’s “1950s pine” is apparently masking the not-so-subtle scent of a poser. As Tracy Moore writes on Jezebel, “… it’s a nice look, but somewhat misleading—reading these [descriptions] feels like meeting a retro sexy librarian type who isn’t actually into books. With the Lumbersexual, the very things that might draw to you such a manly dressed man are likely to disappoint when you discover he won’t be building a campfire, crafting some bookshelves, or investigating that weird noise outside the tent.”

Here in New Hampshire, where we all but invented the woodsy, can-do look of a handy, hale and hearty fella, the emergence of the lumbersexual man presents a problem. How do we tell them apart? Well, I asked this question of some observant, discerning women and came up with the following 12 tips on how distinguish a real New Hampshire man from the carefully crafted catalog version:

The Lumbersexual lets his beard grow and cultivates the style in order to attract good-looking women. The real New Hampshire man grows his beard and chooses his clothing in order to ward off women who only look good.
If you find yourself faced with a bearded, flannel-clad man, ask him how many belts he owns. The Lumbersexual will think for a moment, then answer with a number, like five. The real New Hampshire man won’t understand the question.
Bearded man in denim rides a bicycle to the coffee shop? Likely Lumbersexual.  Drives a pick-up to dump? Probably a real New Hampshire man--that’s where he got his only belt.
If you are the daring type and can get close, take a good sniff.  As we learned, the Lumbersexual smells like vintage pine. The real New Hampshire man has about him the aroma of combusted two-stroke with undertones of off-road diesel. If you like that smell, you are probably a woman from Maine.
If you see a bearded man in plaid using a flip-phone, that is not a Lumbersexual. That is his dad.
Both take pride in their woodpiles. Lumbersexual men stack their wood neatly by the cord, away from the house so that it won’t attract termites and wood ants. Real New Hampshire men stack wood on the porch so their real New Hampshire women don’t have far to go when they fetch it. Chivalry is not dead.
Beard oil? Lumbersexual. Bar oil? Real New Hampshire man.
Real New Hampshire men know that cutting your own firewood warms you three times. Lumbersexuals know that to get Windows to work you have to reboot three times. If your bearded, plaid and denim man laughs at this joke? Lumbersexual.
The lumbersexual man enjoys splitting wood, wielding the refurbished axe he bought at an estate sale. A real New Hampshire man has a love-hate relationship with the chore, and curses the balky hydraulic splitter he borrowed from his neighbor. One of them keeps the woodstove warm all winter.
The lumbersexual man might spend a weekend lining the closet with hand-planed tongue-and-groove cedar to keep the moths out of his flannel shirts. The real New Hampshire man? He really doesn’t need a closet.
Look carefully at the flannel. Is it creased? If so, that’s neither fish nor fowl—what you’ve got there is a Connecticut lawyer who retired to New Hampshire and has decided to run for Selectman.
Real New Hampshire men are members of the Society for the Protection of New Hampshire Forests who volunteer as Land Stewards. Lumbersexual men just wear the hat.

MBC - a lumbersexual poseur:

Lumbersexuals psychologically analyzed

Inevitably, this cherished symbol of Americana and manhood is reduced to a diagnosis of neurosis.

Lumbersexuality, a sport and a pastime

Lumbersexuality and its discontents

Share

Hedge Fund Managers

Abstract: We find that hedge fund managers who own powerful sports cars take on more investment risk. Conversely, managers who own practical but unexciting cars take on less investment risk. The incremental risk taking by performance car buyers does not translate to higher returns. Consequently, they deliver lower Sharpe ratios than do car buyers who eschew performance. In addition, performance car owners are more likely to terminate their funds, engage in fraudulent behavior, load up on non-index stocks, exhibit lower R-squareds with respect to systematic factors, and succumb to overconfidence. We consider several alternative explanations and conclude that manager revealed preference in the automobile market captures the personality trait of sensation seeking, which in turn drives manager behavior in the investment arena.

..men’s testosterone levels increased and decreased partially (directionally), after driving an expensive sports car and an old family sedan, respectively. Additionally, the location of the drive, either a busy downtown area or a semi-deserted highway, partially moderated this response…

Share

Things your Leaf salesman might forget to tell you

I am a BEV advocate. Once you have owned an BEV, you will not go back to ICEV. There is a lot of best-case-scenario discussions of BEVs out there. Here I present what I have read or learned from experience to give you a more realistic idea of the costs and (in)conveniences of living with an BEV. Though some of this may sound negative, it is presented in the spirit of full disclosure.

  • The Leaf loses up to 50% of its value in the first year. Consider leasing if you plan to keep the car for 3 years or less.
  • Range will decline with battery age. How much depends on your charging habits (see below). Certain behaviors can invalidate your warranty. You will sign a form to acknowledge you understand the situations that can invalidate the warranty.
  • The stated 107 mile range of the 30kWh battery is achieved only under ideal conditions. Many factors (speed, use of climate control, multiple passengers, etc.) reduce the practical anxiety free range to about 80 miles.
  • You cannot use the Tesla level 3 chargers to charge a Leaf
  • The level 3 Leaf (Chademo) chargers are more abundant than the Tesla chargers, but most are located on the west coast. In New England most Chademo chargers are located at Nissan dealers or Whole Foods markets, not conveniently positioned in highway rest stops. Consequently, long range driving is not practical in a Leaf.
  • Most BEV owners charge overnight at home and drive their BEV within a 40 mile radius of home.
  • Level 1 charging (120V) requires 20 hours to fill the battery, ~5 miles of range per hour of charging.
  • If you drive daily, depending on how far, you may not have enough time to get a full charge from overnight level 1 charging
  • Level 2 charging (240V, 3.3kW) requires 8 hours to fill the battery, ~12 miles of range per hour of charging.
  • Installing a level 2, 240V charger costs ~$1000 to $2000 (parts and labor)
  • Using off-peak electric rates, it costs ~$2 to fill the battery from empty. This translates to about two cents per mile of driving.
  • The Leaf does not come with a spare tire
  • The spoiler mounted photovoltaic cell is more of a marketing gimmick than a useful feature. It charges the 12V battery.
  • Dealers earn more on service than sales. Your dealership would prefer that you buy a gasoline rather than an electric vehicle.
  • The EZ-charge card (“no charge to charge”) is not universally accepted
  • To utilize the NissanConnectEV app, you must surrender all your Leaf related personal data, including GPS coordinates of your travels, to Nissan.
  • The NissanConnectEV app does not communicate directly with the car. It communicates with the Nissa Data Center using your data plan or Wifi.
  • The Leaf has a telematics unit that allows it to communicate with the Nissan Data Center using the AT&T 3G network.
  • If you are in a location with no AT&T service, all telematics functionality (app connectivity, charging station updates, etc.) is lost.
  • To qualify for the $2500 Massachusetts state rebate you must agree to purchase, register, and drive the Leaf in Massachusetts for three years. You must sign a form agreeing to provide registration information on demand.
  • If you run out of charge on the road you will need to call a tow truck. Most locations don’t have mobile charging units.
  • Beginning with the 2014 model year you no longer have the option to limit charging to 80%
  • The protruding headlights redirect air around the mirrors, reducing drag and wind noise.
  • You can accept a jump start but you should not provide a jump start to another car.
  • It is OK to drive through puddles.
  • The Leaf is unlikely to increase testosterone levels.
  • Because you are not paying gas taxes, some states will charge you a yearly fee for owning a BEV.
  • BEV incentives do not reduce green-house gas emissions and are regressive.
  • The 60KW battery with 100% charge will have ~81 miles of range at 2F (-17C).
  • BEVs were more common in 1900 than ICEVs.
  • Cycle between 20% and 80% charge
  • Do not let the car sit for extended periods of time with 100% or less than 10% charge
  • Do not supercharge (level 3) more than once a day.
  • Do not depend on level 1 charging for routine charging i.e. get a 240V charging station

Behaviors that will invalidate the warranty

  • Do not leave the car at less than -13F for more than 7 days
  • Do not leave the car at more than 120F for more than 24 hours.
  • Do not repeatedly cycle the battery between 95% and 100% charge (top off charging)
  • Other common sense requirements - read the warranty

Note that if you are using the NissanConnectEV app all your personal Leaf related data, including charging behavior and GPS coordinates, is being sent to Nissan.

Additional reading

Death of ICE exaggerated

The Secret Life of an EV Battery

Share

Debian fresh install

Backup

FireFox favorites
Firefox addins unpaywall addblock plus

Copy directories that aren’t syncd:

config files ~/.xxxxx
~/.thunderbird
~/.ssh keys and directory
~/.gnupg
~/.keystorefiles
~/.password-store
~/.electrum
~/.electrum-ltc

Reconfigure ~/syncd/Calibre Library

Bitcoin wallets
~/syncd/ directory
backup mail contacts
Electrum tags

Prep a USB

1
2
3
4
5
$cat /proc/partitions   ;;to see partitions MUST SELECT CORRECT ONE!!!
# tee </dev/zero /dev/sdb1 ;;to erase all
# mkfs.ext2 /dev/sdb1
# chown -R mbc:mbc /media/usb0
$ cp -R ./owncloud/ /media/usb0

Fresh Debian Install

sudo blkid -o list -c /dev/null to see what USB is called
sudo fdisk -l to see name of USB

for XPS (amd64)
root@dc7700s:/home/mbc/Downloads# dd if=debian-8.6.0-amd64-xfce-CD-1.iso of=/dev/sdb

(!not /dev/sdb1)

amd uses the same wifi driver firmware-iwlwifi_0.43_all.deb in blue usb stick “Drivers”
Do not start the install with the wifi driver usb plugged in.
Do not wait for the prompt to plug in wifi driver USB.
Plug in the wifi driver USB once the install has started (but before prompt) otherwise the install will choke.
With the USB in place, the wifi drivers will be found and installed without a prompt.

Selecting encrypted hard drive will start a >10 hour random write to disk which you
can cancel out of and continue install

Select “Guided – use entire disk and set up LVM”; this is for the xfce window manager installation
Partition all files in one partition

UPGRADE to the latest packages

sudo nano /etc/apt/sources.list

comment out the line referring to a cd

deb http://http.debian.net/debian/ wheezy main contrib non-free
deb http://ftp.us.debian.org/debian/ sid main #for electrum (sid is always the unstable release and maybe shouldn’t be included)

#apt-get update && apt-get dist-upgrade

—–”upgrade is used to install the newest versions of all packages currently installed on the system
—–dist-upgrade, in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages”

Install packages of interest

sudo apt-get install conkeror icedove emacs ess guile-2.0 calibre yapet xrandr electrum evince sudo
flahplugin-nonfree chromium rsync referencer nodejs

separately must deal with guile-ncurses litecoin namecoin

configure browser favorites, yapet, mail, electrum seed, conkeror with instapaper, evince,

Copy over ~/.gnupg, ~/.ssh ~/.mutt

Custom configuration

PDFs are opened by default with GIMP; to change:
/usr/share/applications/gimp.desktop
remove from the last line the reference to pdf files

Add a user with no password:
#adduser guest

There is a hack to do this which works. Replace the user’s /etc/shadow password entry with this string…
$1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.
…e.g…
anon1:$1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.:14284:0:99999:7:::

yapet

config file is ~/.yapet
password file is ~/syncd/.pw.pet

load=~/syncd/.pw.pet

chown mbc /home/mbc/owncloud/.pw.pet
chmod 0600 /home/mbc/owncloud/.pw.pet

for Manjaro there is a bug in cfg.h, must edit

diff -uNr yapet-1.0.orig/yapet/cfg.h yapet-1.0/yapet/cfg.h
--- yapet-1.0.orig/yapet/cfg.h 2014-02-23 10:18:41.000000000 -0700
+++ yapet-1.0/yapet/cfg.h 2016-04-14 07:06:49.665672169 -0700
@@ -163,7 +163,7 @@
locked = false;
}

- void is_locked() const {
+ bool is_locked() const {
return locked;
}

https://bugs.guengel.ch/attachment.cgi?id=20&action=edit

must run makepkg
go into yapet-1.0/yapet/cfg.h edit line 167
go into src and ./config then make then make install
if you keep doing mkpkg, you will overwrite the edited cfg.h

Flash player

download from adobe and unpack
cp -r usr/* /usr
some files will conflict with dirs but doesn’t seem to matter

~/.mozilla/plugins/libflashplayer.so is where it goes, may need to make the plugins directory

#apt-get install flashplugin-nonfree

to upgrade
#update-flashplugin-nonfree –install

On chromium - Stretch

deb http://www.deb-multimedia.org stretch main non-free
to /etc/apt/sources.list, then

apt-get update
apt-get install deb-multimedia-keyring
apt-get install flashplayer-chromium

Boot into root prompt

wait for Grub to load, then press e to edit Debian’s entry. After the line with /vmlinuz… add the following:

–add rw init=/bin/bash

add at the end of the line - it is a switch
And press F10 to boot. Debian will load as a shell with root permissions,

to cure the “A start job is running for Create Volatile Files and Directories”

1
2
3
rm -rf /tmp
mkdir /tmp
chmod 1777 /tmp

Stop beep when cursor reaches limit

in /etc/modprobe.d/blacklist.conf

blacklist pcspkr
blacklist snd_pcsp

Bluetooth

$ systemctl status bluetooth

aptitude install blueman

USB with windows

edit fstab so automount mounts as FAT

/dev/sdb1 /media/usb0 vfat rw,user,umask=000,utf8,flush,noauto 0 0

The “user” and “noauto” will allow the user to mount the device automatically when inserted.

The “umask=000” will allow read / write access to everyone.

When you’re done, save fstab, exit gedit, and back in the Terminal type:
sudo mount -a

Printing

aptitude update
aptitude install cups cups-client

/etc/init.d/cups start

sudo usermod -a -G lpadmin pl

Now you can add a printer by going to http://localhost:631/

Use the CUPS driver when queried for LaserJet 4L

Selecting []Print Server in the initial setup may have installed all this

Firefox

https://support.mozilla.org/en-US/questions/1026743

To fix download problem:

Stop Firefox from telling the web server that you will accept compressed files? Here’s how:

(1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.

(2) In the search box above the list, type or paste enco and pause while the list is filtered

(3) Double-click the network.http.accept-encoding preference ( gzip, deflate is the value)

(A) If it has the default value (line is not bolded), delete all of the text and click OK.

(B) If it has a customized value, copy the current value to a safe place for potential later use, then delete all of the text and click OK.

When you visit the site again, Firefox should omit the usual headers saying that it accepted gzip/deflate encoded responses. Any difference?

Share

Photo software installation

try installing libgphoto2 through synaptic first
from: http://ubuntuforums.org/showthread.php?t=1701719

download libgphoto2 http://sourceforge.net/projects/gphoto/postdownload?source=dlp

1
2
3
4
5
6
7
8
$ tar jxf ./libgphoto2-2.5.4.tar.bz2 
$ ./configure --prefix=/usr/local
$ make
$ sudo make install

#lsusb
# sh -c '/usr/local/lib/libgphoto2/print-camera-list udev-rules mode 0660 group plugdev > /etc/udev/rules.d/45-libgphoto2.rules'
# gedit /etc/udev/rules.d/45-libgphoto2.rules

Go to the bottom of the file. Before the end where it says: LABEL=”libgphoto2_rules_end”
Add Code: ATTRS{idVendor}==”VENDORID”, ATTRS{idProduct}==”PRODUCTID”, MODE=”0660”, GROUP=”plugdev”

Save the rules file.
7) Reboot the computer.
8) Turn on camera. Everything should work. (Must use Kodak cable for Easychare camera)

GUI interface at applications / graphics / Gtkam digital camera browser

2016-05-28

Plug camera in using special “Kodak” USB cord.
The cord has the label “Kodak” and a ballast.

Kodak EasyShare C123

Turn camera on.
Use file manager to transfer files

#apt-get install xscreensaver (gnome has its own much inferior screensaver)
configure the “ripples” screensaver to pull images from the Pictures directory

Share

Security

SSH

Make a public and private key pair and place them in the local ~/.ssh directory

1
2
3
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

the public key is ~/.ssh/id_rsa.pub
Transfer this file using rsync to Hostgator. It should be in /home2/mbcladwell/.ssh/authorized_keys

1
rsync -av -e "ssh -p 2222" ~/.ssh/id_dsa.pub mbcladwell@123.123.123.123:.ssh/authorized_keys
1
2
3
4
5
6
7
ssh mbcladwell@123.123.123.123

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown mbcladwell ~/.ssh/authorized_keys


GPG

to get a key:
gpg –keyserver subkeys.pgp.net –recv-keys 219EC810

to add to keyring:
gpg -a –export 55BE302B | apt-key add -

To find an expired key:
apt-key list | grep expired

root@dc7700s:/home/mbc# apt-key list | grep expired
pub 1024D/C4447CF3 2010-11-05 [expired: 2015-03-26]

then run: apt-key adv –recv-keys –keyserver keys.gnupg.net C4447CF3

$ gpg –export-secret-keys -a keyid > my_private_key.asc
$ gpg –export -a keyid > my_public_key.asc

gpg –import public.key
gpg –allow-secret-key-import –import private.key

!!!note the second import

To export secret key for transfer to another computer:

gpg –export-secret-keys –armor –output secret.asc

After fresh install copy ~/.gnupg directory to new machine via USB

Revoke a key

First import into keyring the revocation certificate (previously generated)
$ gpg –import ~/syncd/.gnupg/mystuff/verizonrevocation.txt

Then send the revoked key id to the keyserver
$ gpg –keyserver pgp.mit.edu –send-keys 16D9C90B47237FB3

Then go to the keyserver and query name - should see “revoked” in the first line.

For ~/syncd/.gnupg

in ~/.bashrc must have: export GNUPGHOME=/home/mbc/syncd/.gnupg
#chmod 700 /home/mbc/syncd/.gnupg

Tor

You need to add the following entry in /etc/apt/sources.list or a new file in /etc/apt/sources.list.d/:

deb http://deb.torproject.org/torproject.org wheezy main
deb-src http://deb.torproject.org/torproject.org wheezy main

Then add the gpg key used to sign the packages by running the following commands at your command prompt:

gpg --keyserver keys.gnupg.net --recv 886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -

You can install it with the following commands:

$ apt-get update
$ apt-get install tor deb.torproject.org-keyring

tar -xvJf tor-browser-linux32-5.5.4_en-US.tar.xz
cd to tor director and run batch file.

Miscellaneous

Have I been pawned?

Ten minute email

mbcladwell+website.com@gmail.com attaches destination crumb so you can monitor who is handing out your email. Works only with gmail.

Linux privelage escalation

How to keep your isps nose out of your browser history with encrypted dns

Capture passwords sshing into your server

Share

Hexo

Previously I was working with Jekyll, the most popular static web generator. As I have an interest in Nodejs (and not in Ruby), I wanted to use a site generator that would give me practice with Node. Hexo was the most popular according to staticgen. I am working with the default “Landscape” theme.

Install

1
2
3
4
5

$npm install -g hexo-cli

apt-get install pandoc
npm install hexo-renderer-pandoc

Install hexo-render-pandoc and modify /node_modules/hexo-render-pandoc/index.js:

//var args = [ ‘-f’, ‘markdown’, ‘-t’, ‘html’, ‘–mathjax’, ‘–smart’];
var args = [ ‘-f’, ‘markdown’, ‘-t’, ‘html’, ‘–katex’, ‘–smart’];

1
2

npm install hexo-math --save

Basics


$hexo new draft mypost in the lostnation directory
will create the post in the _drafts subdirectory.
File title will be "mypost.md"
There will be a subdirectory "mypost" that will hold other content (figures, data etc.)
When ready: $hexo publish mypost
Will create 2016-12-06-mypost directory and 2016-12-06-mypost.md file.
$hexo generate will process all files into html
$hexo serve will start a local web server. The local site can be inspected at http://0.0.0.127:4000
$hexo deploy will upload to your web server. FTP parameters are in _config.yml

Hexo deploy

For deploy to work:
update ~/.netrc with site / username / password (for manual ftp diagnosis)
chmod 600 ~/.netrc

~/.netrc
1
machine lostnation.us login lnsDFoKytr@lostnation.us password mypassword

Must generate an FTP user and assign a home directory.
cpanel automatically generates a home directory different from what I want - so change.

_config.yml
1
2
3
4
5
6
7
8
9
10
11
12
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: ftpsync
host: lostnation.us
user: lnsDFoKytr@lostnation.us
pass: mypassword
remote: /
port:
ignore:
connections:
verbose: true

hexo deploy will fail silently without debugging info. Manually ftp to diagnose. Better yet, avoid it entirely.
Use rsync, which is faster and can perform incremental uploads, something hexo deploy can’t do.

lostnation-upload.sh
1
2
3
#!/bin/bash
rsync -avzP --delete --rsh='ssh -p2222' /home/mbc/syncd/lostnation/public/ mbc@nnn.nnn.nnn.215:/home2/mbc/public_html/lnsDFoKytr

The slash after …/public/ is necessary to transfer everything under ./public but not the public itself.
…/public will transfer ../public/…

add items in: /home/mbc/lostnation/themes/landscape/_config.yml

# Header
menu:
Home: /
Archives: /archives
About: /about
rss: /atom.xml

Comments

get rid of the extra comments link in /home/mbc/lostnation/themes/landscape/layout/_partial/article.ejs
comment out:

Templates

Templates are found in the scaffolds directory.
Modify to include categories, comments: true etc.
Anything included in the template will end up in the draft (or post).

RSS icon

http://jr0cket.co.uk/hexo-themes-test/2014/06/hexo-custom-theme---adding-navbar-icon-links-using-fontawesome/
https://github.com/iissnan/hexo-theme-next/issues/153

icons from CSS
http://astronautweb.co/snippet/font-awesome/

in theme modify layout/_partial/header.ejs
move:

    <% if (theme.rss){ %>
      <a id="nav-rss-link" class="nav-icon" href="<%- theme.rss %>" title="<%= __('rss_feed') %>"></a>
    <% } %>
    <a id="nav-search-btn" class="nav-icon" title="<%= __('search') %>"></a>
  <div id="search-form-wrap">
    <%- search_form({button: '&#xF002;'}) %>

up near other links

Favicon

http://stackoverflow.com/questions/30291588/add-favicon-to-hexo-blog

prefer to use my favicon across the entire site, so I’ve linked to the favicon in my theme config. I use Landscape, the default theme included with Hexo.

blog\blog\node_modules\hexo\node_modules\hexo-cli\assets\themes\landscape_config.yml

At the bottom of the file, you’ll find a section titled Miscellaneous.

# Miscellaneous
google_analytics:
favicon: blog\themes\landscape\source\css\images\favicon.ico
twitter:
google_plus:
fb_admins:
fb_app_id:

/home/mbc/lostnation/themes/landscape/source/css/images/favicon.ico

the _config.yml in the themes must look like:

# Miscellaneous
google_analytics:
favicon: /css/images/favicon.ico
twitter:
google_plus:
fb_admins:
fb_app_id:

Theme customization

/home/mbc/lostnation/public/css/images/

/home/mbc/lostnation/themes/landscape/source/css/_variables.styl
contains image path
indicate banner and icon here

/home/mbc/lostnation/themes/landscape/source/css/_partial/header.styl
in header.styl

header.styl
1
2
3
4
5
$logo-text
text-decoration: none
color: rgba(200, 54, 54, 0) was #fff
font-weight: 300
text-shadow: 0 1px 4px rgba(0, 0, 0, 0) fourth 0 was 0.3

Bulk process

Sometimes e.g. during the migration from Jekyll to Hexo, I need to bulk process md files.
Set up process, backup, source, and destination directories.
Below are some useful sed commands for bulk processing


sed -i 's/{% highlight r %}/{% codeblock lang:r %}/g' *
sed -i 's/{% highlight text %}/{% codeblock lang:bash %}/g' *
sed -i 's/{% endhighlight %}/{% endcodeblock %}/g' *
sed -i 's/{% endhighlight %}/{% endcodeblock %}/g' *


sed -i 's/{% highlight sql linenos %}/{% codeblock lang:sql %}/g' *
sed -i 's/{% highlight lisp linenos %}/{% codeblock lang:lisp %}/g' *
sed -i 's/{% highlight r linenos %}/{% codeblock lang:r %}/g' *
sed -i 's/{% highlight html linenos %}/{% codeblock lang:html %}/g' *
sed -i 's/{% highlight elisp linenos %}/{% codeblock lang:elisp %}/g' *

sed -i 's/\/figs\//\/lnsDFoKytr\/figs\//g' *

sed -i 's/{{site.baseurl}}//g' *
sed -i 's/^permalink:.*//g' *
sed -n '/highlight/p' *
sed -n '/playstyle AA^{&̲#39;}/p' *
grep -nwl "playstyle " **/*.md

To copy and move around processed files

Pre modification clean directories:

1
2
3
rm /home/mbc/process/_posts/*.*
rm /home/mbc/process/modpostsbackup/*.*
rm /home/mbc/process/modposts/*.*

working _posts is THE _posts directory used by web

copy from working _posts to processing _posts:

1
2
cp /home/mbc/lostnation/source/_posts/*.*  /home/mbc/process/_posts/
cp /home/mbc/lostnation/source/_posts/*.* /home/mbc/process/modposts/

modposts is where I modify posts

cd /home/mbc/process/modposts/

Recharge the modposts if an error was made

1
2
rm /home/mbc/process/modposts/*.*
cp /home/mbc/lostnation/source/_posts/*.* /home/mbc/process/modposts/

change working posts:

1
2
rm /home/mbc/lostnation/source/_posts/*.*
cp /home/mbc/process/modposts/* /home/mbc/lostnation/source/_posts/

Post modification backup to the cloud:

1
2
rm /home/pl/owncloud/web/lostnation/source/_posts/*.*
cp /home/mbc/lostnation/source/_posts/* /home/pl/owncloud/web/lostnation/source/_posts/

Debugging

Hexo has horrendous error messages - no indication of the file giving the error.
Note also that md files in _drafts will be processed, so any errors there need attention.

Sometimes a keyword will pop out of the error output. Search across files with:

grep -Ril “highlight” ./

R: recursive
i: ignore case
l: show file name, not error
./: where to start looking

Share

nodejs

I want to use sudo-free node with Hexo and blockchain related scripts. Do not use the apt-get method of installation on Debian as that provides a “nodejs” executable rather than “node” which can be problematic (at least with Hexo). I will follow the installation instructions at nearform. There is also a good tutorial at sitepoint.

Determine if node is installed:

1
2
$which node
$which npm

and remove if it is:

1
2
3
4
sudo rm -f /usr/local/share/man/man1/node.1
sudo rm -f /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp

Install using NVM

1
2
3
4
5
#apt-get install curl  ;;if needed
$curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
$nvm install stable ;;; or choose a particular version
## restart terminal
$nvm alias default stable ;; set stable as the default

;;to see where executable reside

1
npm config get prefix

use ~/.npm for local (global) installation
always install with the -g option (global, but with my setup it will be under my home dir, no sudo needed)
the -save option adds the package to the application specific package list, so it will automatically be installed when the package is moved.

Share

Instagram

Use bots to like and comment. Buy content for posting. Get lots of followers. Lose your privacy. Make a fool of yourself. Become an “influencer”.

Share