kme + essential   266

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 
9 weeks ago 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

or:

pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf
pdf  commandline  essential  reference  solution 
9 weeks ago 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
</code>
bash  essential  movein  ssh  configfile  tabcompletion  bashcompletion  solution 
9 weeks ago 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 
10 weeks ago by kme
unp installation and configuration in debian | http://www.debianhelp.co.uk/
You can download the script itself from https://packages.debian.org/stretch/unp; with slight modifications (about two minutes of work), you can adapt the "install" target in 'debian/rules' into a usable Makefile.

See also https://martin.ankerl.com/2006/08/11/program-e-extract-any-archive/, 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(http://www.w3.org/1999/xhtml);

@-moz-document domain("notes.pinboard.in") {
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;
}
}
</code>
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. | https://github.com/
Check out :ArrangeColumn and :UnArrangeColumn. These allow you to use vertical selections to prepend/append to individual columns. Pretty handy!

vim.org link: http://www.vim.org/scripts/script.php?script_id=2830

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

augroup filetypedetect
au! BufRead,BufNewFile *.csv,*.dat,*.tab,*.bed setfiletype csv
augroup END
</code>
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 | https://guide.macports.org/
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:
gnupg2
gpgme
gpg-agent

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: https://github.com/tpope/vim-fugitive/issues/919) 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) [http://entrproject.org/]
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.
filesystem  inotify  cli  automation  utility  sysadmin  commandline  essential  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 (https://addons.mozilla.org/en-us/firefox/addon/pinboard-plus/)
pinboard  firefox  extension  addon  essential  movein 
august 2017 by kme
lostsnow/pinboard-firefox: A better firefox add-on for Pinboard (http://pinboard.in).
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: https://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous
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=a[:]
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/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 re.pl 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/.re.pl/repl.rc
use 5.012;
use warnings;

load_plugin qw(
Colors
Completion
CompletionDriver::INC
CompletionDriver::LexEnv
CompletionDriver::Keywords
CompletionDriver::Methods
DumpHistory
History
LexEnv
ReadLineHistory
Interrupt
);
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/config.py):

<code class="language-python"># Source: https://github.com/jonathanslenders/ptpython/blob/master/examples/ptpython_config/config.py
def configure(repl):
# Ask for confirmation on exit.
repl.confirm_exit = False</code>
python  essential  movein  repl  ptpython  annoyance  configfile 
december 2016 by kme
It's All Text! :: Add-ons for Firefox
On Linux, you'll need this somewhere:
#!/bin/bash
set -eu
exec /usr/bin/gvim --nofork "$@"


On a Mac, just make '/usr/bin/gvim' into '/usr/local/bin/mvim' instead, assuming that you have MacVim installed, and that's where you put the command-line binary.

Choose that as your editor in the preferences (good luck trying to select it from the file picker; better to copy and paste the full pathname into the text box).
firefox  texteditor  browser  extension  plugin  textprocessing  essential  movein  solution 
june 2016 by kme
git merge - What's the simplest way to git a list of conflicted files? - Stack Overflow [http://stackoverflow.com/]
I created an alias for this:

git config --global alias.conflicts "diff --name-only --diff-filter=U"
git  conflicts  merging  diff  solution  movein  essential  dotfile 
june 2016 by kme
GitHub - gregsexton/MatchTag: Vim's MatchParen for HTML tags
To get this to work for file types other than html that use a similar tag structure (e.g Twig templates) you can do something similar to this.

echo 'runtime! ftplugin/html.vim' > ~/.vim/ftplugin/twig.vim
vim  plugin  webdevel  syntaxhighlighting  solution  essential  movein 
june 2016 by kme
bash - How to use double or single bracket, parentheses, curly braces - Stack Overflow
Brackets

if [ CONDITION ] Test construct
if [[ CONDITION ]] Extended test construct
Array[1]=element1 Array initialization
[a-z] Range of characters within a Regular Expression

Curly Braces

${variable} Parameter substitution
${!variable} Indirect variable reference
{ command1; command2; . . . commandN; } Block of code
{string1,string2,string3,...} Brace expansion
{a..z} Extended brace expansion
{} Text replacement, after find and xargs

Parentheses

( command1; command2 ) Command group executed within a subshell
Array=(element1 element2 element3) Array initialization
result=$(COMMAND) Command substitution, new style
>(COMMAND) Process substitution
<(COMMAND) Process substitution

Double Parentheses

(( var = 78 )) Integer arithmetic
var=$(( 20 + 5 )) Integer arithmetic, with variable assignment
(( var++ )) C-style variable increment
(( var-- )) C-style variable decrement
(( var0 = var1<98?9:21 )) C-style ternary operation
bash  newbie  essential  quickref  reference  brackets  braces  parens  shellmath  shellscripting  devel  programming  sysadmin 
april 2016 by kme
« earlier      
per page:    204080120160

related tags

2ddock  abandonware  abi  ack  addon  aerosnap  ag  alias  alternativeto  alttab  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  batchprogramming  batchscripting  beautifier  bestpractices  bitmap  blog  bookmarkbar  bookmarklet  bookmarks  bookmarksbar  bootable  braces  brackets  brokeinupdate  broken  browser  capslock  cheatsheet  checksum  chrestomathy  chrome  cinnamon  cleanup  cli  clipboard  cloudstorage  cmd  cmd.exe  cocoamysql  codesearch  codesigning  collaboration  colors  colorscheme  colorxterm  commandline  comment  comparison  compiler  completion  composekey  compression  conditional  config  configfile  configsetting  configsettings  conflicts  confluence  console  consolefont  constants  contextmenu  contextmenuplugin  conversion  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  draganddrop  drawing  dropbox  dtrx  duplicatefilefinder  eclipse  editor  elementary  elementaryos  emacs  email  equationeditor  equations  errormessage  escaped  essential  ext2  ext3  ext4  extension  extractor  eyecandy  faenza  faq  favicon  favorite  fileencoding  filelink  filemanagement  filemanager  filenames  filesharingprotocols  filesystem  filesystems  finder  firefox  firewall  fish  flask  fogapp  fogger  font  fonts  formatter  forms  formulas  framebuffer  freesoftware  freeware  fuckina  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  inputdevice  inspiration  interesting  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  linkchecker  linter  linux  linuxhasthisbuiltin  linuxmint  list  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  paste  patch  pathname  patternmatching  pdf  perl  php  pinboard  pinchtozoom  pipes  pipeviewer  plugin  portableapp  postscript  powershell  powertoys  prettifier  prettyprinting  printing  privacy  processmanagement  productivity  profile  programming  projectdrawer  ps  ptpython  publickeyauthentication  putty  pv  python  qt  qtwebkit  quantifier  quickref  quickreference  quicksilver  quoting  rails  rcs  recommendation  recommendations  redirection  reference  regex  regexp  regularexpression  remap  remoteaccess  remoteadmin  removablemedia  repl  report  revealcodes  revisioncontrol  rightmousebuttonresize  ruby  ruler  samplecode  sata  scm  screenscraper  screensharing  screenshot  script  scripting  searchandindex  searchengine  security  sed  sendto  sendtomenu  sendtotoys  services  sha1  sha1sum  sharing  shasum  shell  shellenhancement  shellfunctions  shellmath  shellscripting  shortcut  shortcutkey  shortcuts  slices  slides  slideshow  snippets  social  software  softwareupdate  solarized  solution  sorting  specialcharacters  sqlalchemy  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  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  unicode  unix  unp  unpacker  updater  url  urlhandler  urlshortener  urlshortening  usb  usb3  userhelp  userstyle  utility  versioncontrol  versioning  vhost  vi  vim  vimode  vista  visualstyle  vscode  wallpaper  webannoyances  webapp  webdesign  webdevel  webmaster  webserver  wiki  wikitext  win7  windowmanagement  windowmanager  windows  windowsonly  windowsupdate  wordpress  workflow  wtfjavascript  x11  xterm-256color  xtermcolors  zip  zsh 

Copy this bookmark:



description:


tags: