kme + essential   285

You can make readline (and bash) much more user friendly by adding a few options to ~/.inputrc : commandline |
set completion-prefix-display-length 2

This one is insanely useful when you have a folder with lots of similarly named files and you are not sure how far the completion has gone when you press TAB. The first part that has been completed will be replaced by "...", and it is simple to see what you need to type to finish the completion.
inputrc  input  readline  bash  cli  configfile  configsettings  example  newbie  movein  essential 
17 days ago by kme
Remember all your bash history forever |
WATCH OUT! Old-ass versions of Bash (4.1.x on CentOS 6, for example) will truncate your damn history file if you use HISTFILESIZE=-1 or HISTSIZE=-1.
Append the following lines to /etc/bash.bashrc:
<code class="language-bash">HISTTIMEFORMAT='%F %T '
shopt -s histappend # append to history, don't overwrite it
# attempt to save all lines of a multiple-line command in the same history entry
shopt -s cmdhist
# save multi-line commands to the history with embedded newlines
shopt -s lithist</code>

This configures bash to save every command line typed at the interactive shell prompt (HISTFILESIZE) to ~/.bash_history (default), including a timestamp (HISTTIMEFORMAT) and ignoring consecutive duplicate entries (HISTCONTROL). By setting HISTSIZE to the same value as HISTFILESIZE, all saved commands are read back to memory when a new interactive shell starts. The default value for HISTSIZE (500) would load only a fraction of the saved history.

When saving the history at shell exit, history lines are appended to existing ones, instead of replacing them (shopt -s histappend).

By setting HISTIGNORE=?:??, lines consisting of just one or two characters are discarded from the history (e.g. ls commands).
bash  history  tipsandtricks  configsettings  essential  movein  bashrc 
17 days ago by kme
Bash Reference Manual: Bash History Builtins |
A useful alias to use with the fc command is r='fc -s', so that typing ‘r cc’ runs the last command beginning with cc and typing ‘r’ re-executes the last command (see Aliases).
bash  history  tipsandtricks  bashrc  bash_aliases  movein  essential 
17 days ago by kme
Extension:PlaceNewSection - MediaWiki |
You need to add __ADDNEWSECTIONBELOW__ and __NEWSECTIONLINK__ to your article (if it's outside the "Talk" namespace) in order to get this working. But it works!

Other useful references:

* - (Make it possible to) always ignore NEWSECTIONLINK in mainspace at the English Wikipedia
mediawiki  editing  extension  movein  essential  fuckina  solution 
may 2018 by kme
Manual:Short URL/Apache - MediaWiki |
In the Apache config (for the vhost or whatever):
<code class="language-apache">##

# Enable the rewrite engine
RewriteEngine On

# Short URL for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]

# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]

In 'LocalSettings.php':
<code class="language-php">
$wgScriptPath = "/w"; // this should already have been configured this way
$wgArticlePath = "/wiki/$1";
mediawiki  essential  movein  shorturl  configfile  webmaster  apache  solution 
may 2018 by kme
Extension:LinkTarget - MediaWiki |
Allows specifying external link targets with a specific class on the parent div.
mediawiki  linktarget  link  html  extension  essential  movein 
march 2018 by kme
UNC links - MediaWiki |
<code class="language-wikitext">[file:///{{#replace:{{#replace:{{{1}}}| |%20}}|\|/}} {{#if:{{{2|}}}|{{{2}}}}}]</code>
mediawiki  windows  networking  cifs  unc  fileprotocol  customization  essential  movein  sysadmin 
march 2018 by kme
Vertical rulers in Visual Studio Code? - Stack Overflow
VS Code 0.10.10 introduced this feature. To configure it:

Go to File > Preferences > User/Workspace settings
Add for example this line to your custom settings on the right: "editor.rulers": [80,120]
editor  devel  vscode  margin  ruler  configsetting  essential  solution 
december 2017 by kme
PDFtk Server Examples
Remove page 13 from in1.pdf to create out1.pdf

pdftk in.pdf cat 1-12 14-end output out1.pdf


pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
pdf  commandline  essential  reference  solution 
december 2017 by kme
Enable Tab Completion for SSH Aliases
Blog formatting gremlins ate a bunch of extra backlashes, so you can't just copy-and-paste. The correct version with the missing backslashes is:

<code class="language-bash">
complete -o default -o nospace -W \
"$(/usr/bin/env ruby -ne 'puts $_.split(/[,\s]+/)[1..-1].reject{|host| host.match(/\*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" \
scp sftp ssh
bash  essential  movein  ssh  configfile  tabcompletion  bashcompletion  solution 
december 2017 by kme
Hourglass in Launchpad
No, the app does not need to be running for the alarms to work. And 'at' doesn't seem to have been installed as a dependency, so Hourglass has its own persistent daemon apparently, or else the notification system allows you to create timed notifications.
elementaryos  utility  app  essential  movein 
december 2017 by kme
unp installation and configuration in debian |
You can download the script itself from; with slight modifications (about two minutes of work), you can adapt the "install" target in 'debian/rules' into a usable Makefile.

See also, written in Ruby. Does not have built-in help, though.
unp  unpacker  debian  archive  commandline  utility  essential  movein  solution  reference 
october 2017 by kme
Gussy up Pinboard Notes
Here's a userstyle to improve the appearance of the Markdown note display:

<code class="language-css">
@namespace url(;

@-moz-document domain("") {
blockquote.note {
font-family: Menlo, Open Sans, Arial, helvetica;

blockquote.note a:hover {
text-decoration: underline !important;

code {
margin: inherit !important;
padding: 0 3px 2px;
color: #222;
background: #efefef;
font-family: "Ubuntu Mono",Roboto,"DejaVu Sans Mono",monaco,courier,monospace;

See also:
pinboard  userstyle  css  annoyance  solution  webdesign  essential  movein  from notes
october 2017 by kme
GitHub - vim-scripts/csv.vim: A Filetype plugin for csv files. |
Check out :ArrangeColumn and :UnArrangeColumn. These allow you to use vertical selections to prepend/append to individual columns. Pretty handy! link:

<code class="language-vim">
" create this as ~/.vim/filetype.vim
if exists("did_load_csvfiletype")
let did_load_csvfiletype=1

augroup filetypedetect
au! BufRead,BufNewFile *.csv,*.dat,*.tab,*.bed setfiletype csv
augroup END
Syntax error when opening a CSV file

If you see this error:

<code>CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\)</code>

This happens usually, when the syntax script is read before the filetype plugin, so the plugin did not have a chance to setup the column delimiter correctly.

The easy way to fix it, is to make sure the :syntax on (:syn-on) statement comes after the :filetype plugin (:filetype-plugin-on) statement in your .vimrc

Alternatively, you can simply call InitCSV and ignore the error.
Autocommand on opening/closing files

Alternatively, you can restrict this setting to files below a certain size. For example, if you only want to enable this feature for files smaller than 1 MB, put this into your .vimrc

let g:csv_autocmd_arrange = 1
let g:csv_autocmd_arrange_size = 1024*1024
vim  script  csv  syntaxhighlighting  programming  plugin  delimitedtext  textprocessing  errormessage  essential  movein  solution 
october 2017 by kme
3.3. Common Tasks |
If you want to find all ports that depend on a given other port, you can use

$ port echo depends:<portname>

If you are only interested in the dependent ports that you actually have installed, you can use the quicker and more accurate dependents:

$ port dependents <portname>

$ port dependents libksba

gnupg2 depends on libksba
gpg-agent depends on libksba

MacPorts also has a recursive version of the dependents action called rdependents:

$ port rdependents libksba

The following ports are dependent on libksba:

Finally, to find out which port you manually installed caused the automatic installation of a dependency, use the following expression:

$ port installed requested and rdependentof:<portname>

$ port installed requested and rdependentof:libksba
mac  osx  packagemanagement  macports  dammitbrain  essential  sysadmin  reference 
september 2017 by kme
tpope/vim-fugitive: fugitive.vim: a Git wrapper so awesome, it should be illegal
You can "set splitright" (as mentioned here: if you want :Gdiff to stop splitting horizontally, which is super-annoying.
vim  extension  github  git  plugin  essential  movein 
august 2017 by kme
entr(1) []
Yup, this does what I want, for the most part.

Redirection is a problem, because it doesn't shell out, it really just executes the first argument you give it as a problem. But 'bash -c "some long command line"' works, as does '-s "pipe | line"' for pipelines.

Also, this is badass:
<code class="language-bash">$ ls *.css *.html | entr reload-browser Firefox</code>
filesystem  inotify  cli  automation  utility  sysadmin  commandline  essential  webdevel  livereload  fuckina  solution 
august 2017 by kme
Pinboard Bookmark :: Add-ons for Firefox
This seems to be the only extension that works after the 52.x update killed the "official" Pinboard extension.

Edit: Pinboard+ is also okay (
pinboard  firefox  extension  addon  essential  movein 
august 2017 by kme
lostsnow/pinboard-firefox: A better firefox add-on for Pinboard (
This is where it's at now that Firefox is disabling legacy addons.

Things that need work:

- padding in the door hanger menu
- "Tags" field should have focus by default
- hotkey should be configurable
pinboard  extension  essential  needshelp 
august 2017 by kme
How to stop auto indenting | Vim Tips Wiki | FANDOM powered by Wikia
Disabling file type based indentation for a specific file typeEdit

You may like auto indenting in C programs, but dislike it when editing html files. You can disable auto indentation for particular files types; the following example shows how to do this for html files.

Create the file ~/.vim/indent/html.vim on Unix-based systems, or $HOME/vimfiles/indent/html.vim on Windows systems, containing the single line:

let b:did_indent = 1

This creates a user-specific indent script which will be loaded before the file type indent script. Auto indenting for the particular file type is disabled because well-behaved indent scripts do nothing if the buffer-local variable b:did_indent is defined (that variable indicates that the current buffer already has script-based indenting enabled).
vim  autoindent  config  essential  annoyance  solution 
july 2017 by kme
Help:Extension:ParserFunctions - MediaWiki
You can use ParserFunctions conditionals within tags created by other extensions (like <source>), you just need to do it this way:
Substitution does not work within <ref>…</ref>, you can use {{subst:#tag:ref|…}} for this purpose.

See also:
mediawiki  extension  essential  movein  solution 
june 2017 by kme
MovingToPythonFromOtherLanguages - Python Wiki
Python indexes and slices for a six-element list.
Indexes enumerate the elements, slices enumerate the spaces between the elements.

<code>Index from rear: -6 -5 -4 -3 -2 -1 a=[0,1,2,3,4,5] a[1:]==[1,2,3,4,5]
Index from front: 0 1 2 3 4 5 len(a)==6 a[:5]==[0,1,2,3,4]
+---+---+---+---+---+---+ a[0]==0 a[:-2]==[0,1,2,3]
| a | b | c | d | e | f | a[5]==5 a[1:2]==[1]
+---+---+---+---+---+---+ a[-1]==5 a[1:-1]==[1,2,3,4]
Slice from front: : 1 2 3 4 5 : a[-2]==4
Slice from rear: : -5 -4 -3 -2 -1 :
b==[0,1,2,3,4,5] (shallow copy of a)</code>
python  arrays  slices  arrayslice  syntax  reference  newbie  essential  solution 
march 2017 by kme
vim-syntastic/syntastic: Syntax checking hacks for vim
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
vim  plugin  linter  syntaxchecking  staticanalysis  essential  movein 
january 2017 by kme
vim - How to use vi mode in fish shell? - Stack Overflow
Vi mode will be in version 2.2.0. If you want to use it now, do the following:

Install a nightly build. If you're using Linux, you can get a nightly from here. On OS X using homebrew, use brew install fish --HEAD. You can also build from source following the instructions in the readme.
Run fish_vi_mode to try it. If you want to make it the default, add a line fish_vi_mode to ~/.config/fish/
vim  keybindings  vimode  fish  configfile  customization  essential  movein  solution 
january 2017 by kme
An Introduction to Pandas | synesthesiam
Actually does a good job of explaining indexing (the '[]' syntax) and filtering. Because, fuck.

Why .ix needs .ix[idx] and not .ix(idx), I'll probably never understand.
python  pandas  tutorial  newbie  essential  reference 
january 2017 by kme
linux - Sort a tab delimited file based on column sort command bash - Stack Overflow
To sort on the fourth column use just the -k 4,4 selector.

sort -t $'\t' -k 4,4 <filename>

You might also want -V which sorts numbers more naturally. For example, yielding 1 2 10 rather than 1 10 2 (lexicographic order).

sort -t $'\t' -k 4,4 -V <filename>

If you're getting errors about the $'\t' then make sure your shell is bash. Perhaps you're missing #!/bin/bash at the top of your script?
bash  essential  sorting  textprocessing  dammitbrain  reference 
december 2016 by kme
command line - sponge from moreutils - what's the difference to shell redirect? useful examples? - Unix & Linux Stack Exchange
But how do you make changes to input? With standard POSIX toolchest, you need to use a temporary file, some thing like:

grep -v '^#' input >/tmp/input.tmp
mv /tmp/input.tmp ./input

With shell redirection:

grep -v '^#' input >input

will truncate input before you reading from it.

With sponge, you can:

grep -v '^#' input | sponge input
bash  shell  shellscripting  pipes  redirection  dammitbrain  movein  essential  reference 
december 2016 by kme
xenoterracide: Making usable
Update 2017-10-25: Finally found out how to keep Ctrl+C from terminating the REPL--add the "Interrupt" plugin

# put this in $HOME/
use 5.012;
use warnings;

load_plugin qw(
perl  repl  config  configfile  movein  syntaxhighlighting  history  completion  solution  fuckina  essential 
december 2016 by kme
Quick and Easy Way to List All the Windows Updates Installed on Your System | Gizmo's Freeware
Some programs, such as Belarc Advisor, will include a list of updates in an overall analysis of what is on your computer. This type of comprehensive survey of your computer’s contents is worthwhile but there is also an easier way to get a list of Windows updates. This method takes advantage of the command line and requires no installation of additional software. Open the command prompt and enter this command:

wmic qfe list brief /format:htable > "%USERPROFILE%\hotfix.html"

This produces a nicely formatted list in an HTML file named hotfix.html that gets placed in the User folder. You can, of course, change the destination to some other convenient location. If there are any spaces in the name of a folder that you choose, don’t forget to wrap the destination name in quotes, as is done in the commands given in this tip.

If you would rather have a text file, the command would be:

wmic qfe list brief /format:texttablewsys > "%USERPROFILE%\hotfix.txt"
windows  windowsupdate  essential  troubleshooting  logging  sysadmin  solution  win7  patch  hotfix  report 
december 2016 by kme
GitHub - jonathanslenders/ptpython: A better Python REPL
Don't prompt to exit (put in ~/.ptpython/

<code class="language-python"># Source:
def configure(repl):
# Ask for confirmation on exit.
repl.confirm_exit = False</code>

Sample config is here:
python  essential  movein  ptpython  annoyance  configfile  repl 
december 2016 by kme
« earlier      
per page:    204080120160

related tags

2ddock  abandonware  abi  ack  addon  aerosnap  ag  alias  alternativeto  alttab  android  anki  annotation  annoyance  annoyances  antialiasing  apache  api  app  applescript  application  apt-get  aptanastudio  archive  arrays  arrayslice  asanide  ascii  asciiart  atlernativeto  attachments  autocomplete  autoindent  autojump  automaticupdates  automation  autoreload  backupandrecovery  bash  bashcompletion  bashrc  bash_aliases  batchprogramming  batchscripting  beautifier  bestpractices  bitmap  blog  bookmarkbar  bookmarklet  bookmarks  bookmarksbar  bootable  braces  brackets  brokeinupdate  broken  browser  browsing  build  capslock  centos  cheatsheet  checksum  chrestomathy  chrome  cifs  cinnamon  cleanup  cli  clipboard  cloudstorage  cmd  cmd.exe  cocoamysql  codesearch  codesigning  collaboration  colors  colorscheme  colorxterm  commandline  comment  comparison  compiler  completion  composekey  compression  conditional  conditionals  config  configfile  configsetting  configsettings  conflicts  confluence  console  consolefont  constants  containers  contextmenu  contextmenuplugin  conversion  copyandpaste  cplusplus  crapcleaner  crlf  crossbrowser  crossplatform  crypto  css  csv  curses  customization  cya  cygwin  dammitbrain  dashboard  database  date  dateandtime  datetime  dba  debian  defunct  delimitedtext  design  designinspiration  desktop  desktopcustomization  desktopicons  desktopmedia  desktoptweaks  devel  diff  differ  digraph  directorycomparison  dock  documentation  doswindows  dotfile  dotfiles  doubleplusgood  draganddrop  drawing  dropbox  dtrx  duplicatefilefinder  eclipse  editing  editor  elementary  elementaryos  emacs  email  equationeditor  equations  errormessage  escaped  essential  example  ext2  ext3  ext4  extension  extractor  eyecandy  faenza  faq  favicon  favorite  fileencoding  filelink  filemanagement  filemanager  filenames  fileprotocol  filesharingprotocols  filesystem  filesystems  finder  firefox  firewall  fish  flask  fogapp  fogger  font  fonts  formatter  formatting  forms  formulas  framebuffer  freesoftware  freeware  fromsource  fuckina  fuckingfinally  fuzzyfinder  g++  gatekeeper  gcc  gestures  ghostscript  git  git-reset  github  gmail  gmailimaptimestampproblem  gnome  gnu  graphics  grep  gui  hacking  handwritingrecognition  handy  hardware  hash  help  hidpi  histfile  history  hotfix  hotkey  hotkeys  howto  html  html5  httpstatuscodes  icon  icons  ide  idiom  illegalcharacters  imageprocessing  imap  importexport  in  initialization  inotify  input  inputdevice  inputrc  inspiration  interesting  ios  iptables  javascript  jinja  jinja2  json  keepass  keybinding  keybindings  keyboard  keyboardshortcuts  keyconfig  keys  labcomputers  language  latex  launchy  ldap  ldapsearch  less  libc  library  libreoffice  libstdc++  lightbox  likeamac  likechrome  likelinux  likeunix  likewindows  link  linkchecker  linktarget  linter  linux  linuxhasthisbuiltin  linuxmint  list  livereload  liveusb  logging  lsof  mac  mac-like  macports  mailconversion  margin  markdown  marks  math  mavericks  maybesolution  md5  mediawiki  merging  metacity  minimap  module  monospace  motioncommands  mouse  move  movein  mozilla  multitouch  mutt  mysql  needshelp  nerdtree  netbeans  networking  newbie  newtabpage  nonfree  nongreedy  oneliners  onlinestorage  opensource  orthodoxfilemanager  osx  outlook  packagemanagement  packaging  pandas  par  parens  parser  parserfunctions  paste  patch  pathname  patternmatching  pdf  perl  php  pinboard  pinchtozoom  pipes  pipeviewer  plugin  portableapp  postscript  powershell  powertoys  prettifier  prettyprinting  printing  privacy  processmanagement  productivity  profile  programming  progressbar  projectdrawer  ps  ptpython  publickeyauthentication  putty  pv  python  qt  qtwebkit  quantifier  quickref  quickreference  quicksilver  quoting  rails  rcs  readline  recommendation  recommendations  redirection  reference  regex  regexp  regularexpression  regularexpressions  remap  remoteaccess  remoteadmin  removablemedia  repl  report  revealcodes  revisioncontrol  rightmousebuttonresize  ruby  ruler  samplecode  sata  scm  screenscraper  screensharing  screenshot  script  scripting  searchandindex  searchengine  searchpatterns  security  sed  sendto  sendtomenu  sendtotoys  services  sha1  sha1sum  sharing  shasum  shell  shellenhancement  shellfunctions  shellmath  shellprogramming  shellscripting  shortcut  shortcutkey  shortcuts  shorturl  slices  slides  slideshow  snippets  social  software  softwareupdate  solarized  solution  sorting  specialcharacters  splitpane  splitview  sqlalchemy  srpm  ssb  ssh  ssh-copy-id  sshtunnelling  standards  staticanalysis  storage  strftime  style  styleguide  styling  sublimetext  symlinks  syntax  syntaxchecking  syntaxhighlighting  syntaxhighllighting  sysadmin  systemmonitoring  tabcompletion  table  tags  taskswitcher  telnet  templates  terminal  terminalemulator  testing  textarea  textediting  texteditor  texter  textmode  textprocessing  theme  thunderbird  tidy  time  timezone  tinyurl  tipsandtrick  tipsandtricks  tmux  toolbar  toolchain  toolkit  translation  troubleshooting  tui  tutorial  tweaks  typesetting  ubuntu  ui  unarchiver  unc  unicode  unix  unp  unpacker  updater  url  urlhandler  urlshortener  urlshortening  usb  usb3  userhelp  userstyle  utility  variable  versioncontrol  versioning  vhost  vi  vim  vimcommandline  vimdiff  vimode  vimvariables  vista  visualstyle  vscode  wallpaper  webannoyances  webapp  webbrowser  webdesign  webdevel  webmaster  webserver  wiki  wikitext  win7  win8  windowmanagement  windowmanager  windows  windowsonly  windowsupdate  wordpress  workflow  wtfjavascript  x11  xterm-256color  xtermcolors  zip  zsh 

Copy this bookmark: