kme + configfile   318

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
readline - How do I reload .inputrc using a bash script? - Super User |
Use the bind command:
<code class="language-bash">
bind -f ~/.inputrc

See help bind for more information:
-f filename Read key bindings from FILENAME.
keybindings  macros  inputrc  bash  configfile  configsettings  solution 
17 days ago by kme
bash - How do I reload .inputrc? - Super User |
Interesting, but doesn't work for me.
By default, C-x C-r is bound to re-read-init-file.

See the Bash Reference Manual for explanation.
bash  inputrc  keyboard  readline  configfile 
17 days ago by kme
linux - How to show line number when executing bash script - Stack Overflow |
<code class="language-bash">export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'</code>
bash  shellscripting  devel  debugging  configfile  movein  tipsandtricks  solution 
11 weeks ago by kme
webdav - How do I enable HTTP-DAV in Apache? - Server Fault |
Yup, I made this mistake, too:
I finally figured it out.

Instead of
<code class="language-apache"><Location /var/www/html/updates>
Dav On

it needs to be (Directory instead of Location)
<code class="language-apache"><Directory /var/www/html/updates>
Dav On
apache  webmaster  configfile  webdav  solution  fuckina 
august 2018 by kme
Mailing List Archive: Re: MediaWiki 1.28.0 Extension LDAPAuthentication does not work |
There is a new permission available that governs the right to create accounts when logging in with an external user account. It's called "autocreateaccount" [0]. You have to add to your config something like:
<code class="language-php">$wgGroupPermissions['*']['autocreateaccount'] = true;</code>

Or maybe this is enough:
<code class="language-php">$wgGroupPermissions['user']['autocreateaccount'] = true;</code>

See also
mediawiki  ldap  authentication  config  configfile  solution 
june 2018 by kme
php - Removing X-Powered-By - Stack Overflow |

I think that is controlled by the expose_php setting in PHP.ini:
<code class="language-php">expose_php = off</code>

Decides whether PHP may expose the fact that it is installed on the server (e.g. by adding its signature to the Web server header). It is no security threat in any way, but it makes it possible to determine whether you use PHP on your server or not.

There is no direct security risk, but as David C notes, exposing an outdated (and possibly vulnerable) version of PHP may be an invitation for people to try and attack it.
php  webdevel  webmaster  security  configfile  configuration  solution  dammitbrain 
may 2018 by kme
Change Apache httpd "Server:" HTTP header - Unix & Linux Stack Exchange |
I simply changed the directives in security.conf and Apache started working as I wanted.
<code class="language-apache">
ServerTokens Prod
ServerSignature Off
webmaster  apache  httpd  config  configfile  security  configuration  solution  dammitbrain 
may 2018 by kme
numpy - Automatically import modules when entering the python or ipython interpreter - Stack Overflow |
Use the environment variable PYTHONSTARTUP. From the official documentation:
If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so that objects defined or imported in it can be used without qualification in the interactive session.

python  ipython  ptpython  startup  configfile  solution 
may 2018 by kme
MySQL :: MySQL 8.0 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program |
The "options file handling" options need to come *first* on the command line, otherwise you get an error like what's described in this bug report[1] like "mysql: unknown variable 'defaults-group-suffix=:whatever'"

dba  sysadmin  mysql  mysqldump  configfile  optionsfile  tipsandtricks  errormessage  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
vagrantfile - Print message after booting vagrant machine with "vagrant up" - Stack Overflow |
Vagrant now has builtin support for a message to appear after vagrant up. Just add this to your Vagrantfile:

<code class="language-ruby">config.vm.post_up_message = "This is the start up message!"</code>

And then after your VM has come up you'll see this message in green:

<code>==> default: Machine 'default' has a post `vagrant up` message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: This is the start up message!</code>
vagrant  vagrantfile  provisioning  configfile  solution 
may 2018 by kme
yourls_allow_duplicate_longurls where to set it to allow · Issue #2186 · YOURLS/YOURLS · GitHub |
File: user/config-sample.php:49

<code class="language-php">/** Allow multiple short URLs for a same long URL
** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
** Set to false to allow multiple short URLs pointing to the same long URL ( behavior) */
define( 'YOURLS_UNIQUE_URLS', true );</code>

Set it to false in your config file.
php  yourls  configfile  configsetting  solution 
april 2018 by kme
dual boot - How to get grub2 to remember last choice? - Ask Ubuntu -
The documentation in this case is wrong. All variables in /etc/default/grub start with GRUB_, so it's GRUB_DEFAULT=saved, not DEFAULT=saved. I've corrected the Ubuntu wiki to reflect that.

The official grub manual describes this correctly:

Put the following in /etc/default/grub:
<code class="language-bash">

Then run:
<code class="language-bash">
sudo update-grub
linux  windows  grub  grub2  dualboot  bootmanager  configfile  configsetting  dammitbrain  solution 
march 2018 by kme
python - Booleans in ConfigParser always return True - Stack Overflow |
Use getboolean():

<code class="language-python">print config.getboolean('main', 'some_boolean')
print config.getboolean('main', 'some_other_boolean')</code>

From the Python manual:

RawConfigParser.getboolean(section, option)

A convenience method which coerces the option in the specified section to a Boolean value. Note that the accepted values for the option are "1", "yes", "true", and "on", which cause this method to return True, and "0", "no", "false", and "off", which cause it to return False. These string values are checked in a case-insensitive manner. Any other value will cause it to raise ValueError.
python  webdevel  configfile  configparser  solution 
february 2018 by kme
string - Bash: custom PS1 with nice working directory path - Stack Overflow |
Downside: It depends on the directory level, not the length of the path, which you might not want.

Upside: It's very simple. Just add export PROMPT_DIRTRIM=2 to your .bashrc.
bash  promptstring  bashrc  configfile  tipsandtricks  movein  solution 
december 2017 by kme
mysql - Why don't my .my.cnf settings work? - Database Administrators Stack Exchange |
So after a bit of research, I found this link ( and came up with the following ~/.my.cnf that worked for me:

password = mypass
database = dbname
host =

and the command that reads it:

<code class="language-bash">
mysql --defaults-group-suffix=dbid

A couple things to point out (highlights from the article linked):

* group has to be preceded by 'client' to be read by mysql

* has to go after any [client] groups, otherwise it will be overridden
dba  mysql  configfile  tipsandtricks 
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
Alternative way to clear search · Issue #131 · tpope/vim-sensible
I like mapping to <CR> because I can still use <Ctrl>+L for vim-tmux-navigator, but I prefer Tim's way of clearing the search, because you can still use n/N to pick up where you left off, after clearing the highlighting.

<code class="language-vim">
set incsearch
" Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
I don't know where I found this but I did quite some research on the topic and it turns out the best way is to do:

<code class="language-vim">
nnoremap <CR> :let @/ = "" <bar> echo "search string cleared whatever" <CR>

This being if you want the mapping to be on Enter, which I find really useful

I can't back this up with anything except that it works and doesn't break anything else, but I thought it would be useful.
searching  vim  configfile  tipsandtricks  movein  solution 
december 2017 by kme
Suggestion: set synmaxcol to sane levels · Issue #142 · tpope/vim-sensible
Hey, just wanted to suggest setting synmaxcol to a sensible level, it's 3000 by default!, and this makes no sense.

I learned of it while talking on #vim how editing an HTML with minified CSS line completely slowed everything down. As it's not sane to have human content reach this limit, I think bringing this value down to 300 or something is better than having it at 3000.
vim  tipsandtricks  configfile  syntaxhighlighting 
december 2017 by kme
systemd for Administrators, Part III
So, let's jump right in. As an example we'll convert the init script of the ABRT daemon into a systemd service file. ABRT is a standard component of every Fedora install, and is an acronym for Automatic Bug Reporting Tool, which pretty much describes what it does, i.e. it is a service for collecting crash dumps. Its SysV script I have uploaded here.

Here's what I came up with for a Sinatra Rack app:

Description=Run manservant on port 9292
# source:



With the help of these references:

systemd  initsystem  sysadmin  tutorial  configfile  sortof  solution 
december 2017 by kme
6.12. pam_issue - add issue file to user prompt
Yeah, but in elementaryOS Luna, the pam.d/login thing mentioned in the README.Debian doesn't work. You have to edit /etc/init/ttyX.conf, and add '-f /etc/issue.linuxlogo' to each "getty" invocation.
debian  ubuntu  elementaryos  elementary  console  eyecandy  configfile  workaround  maybe  solution 
december 2017 by kme
vim - Why some people use 'if has("gui_running")' in a .gvimrc? - Stack Overflow
Note that the 'fuoptions' config setting in the example is Mac OS X only.

Usually what I want is just something like this:

<code class="language-vim">
if has("gui_running")
if has("x11")
set lines=52 guioptions-=T
vim  configfile  dammitbrain  reference  solution 
november 2017 by kme
Easier buffer switching | Vim Tips Wiki | FANDOM powered by Wikia |
<code class="language-vim">" Mappings to access buffers (don't use "\p" because a
" delay before pressing "p" would accidentally paste).
" \l : list buffers
" \b \f \g : go back/forward/last-used
" \1 \2 \3 : go to buffer 1/2/3 etc
nnoremap <Leader>l :ls<CR>
nnoremap <Leader>b :bp<CR>
nnoremap <Leader>f :bn<CR>
nnoremap <Leader>g :e#<CR>
nnoremap <Leader>1 :1b<CR>
nnoremap <Leader>2 :2b<CR>
nnoremap <Leader>3 :3b<CR>
nnoremap <Leader>4 :4b<CR>
nnoremap <Leader>5 :5b<CR>
nnoremap <Leader>6 :6b<CR>
nnoremap <Leader>7 :7b<CR>
nnoremap <Leader>8 :8b<CR>
nnoremap <Leader>9 :9b<CR>
nnoremap <Leader>0 :10b<CR>
" It's useful to show the buffer number in the status line.
set laststatus=2 statusline=%02n:%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P</code>
vim  buffers  tipsandtricks  configfile 
november 2017 by kme
Syntax Highlighting for Template Toolkit (.tt files) in VIM - Stack Overflow |
<code class="language-vim">
" ~/.vim/ftdetect/tt.vim
autocmd BufNewFile,BufRead *.tt setf tt2
autocmd BufNewFile,BufRead * serf tt2html
vim  perl  webdevel  templatetoolkit  syntax  filetype  configfile  solution 
october 2017 by kme
linux - How do I set the default kernel parameters in CentOS for all existing and future kernels? - Server Fault -
You can have it apply to all current and any future kernels by using ALL. grubby --update-kernel=ALL --remove-args="rhgb quiet" – benjarrell Jul 2 '13 at 18:04

You can also add '--args="vga=792"' to get a decent console resolution.
centos  centos6  grub  console  consolefont  framebufferconsole  configfile  solution 
october 2017 by kme
git - How do I make GitLab delete old backups? - Server Fault |
In /etc/gitlab/gitlab.rb I added the following line:

gitlab_rails['backup_keep_time'] = 60

Don't forget 'gitlab-ctl reconfigure' after that.
gitlab  backupandrecovery  backup  sysadmin  configfile  solution 
october 2017 by kme
Authentication log · User Settings · GitLab |
GitLab defaults its time zone to UTC. It has a global timezone configuration parameter in /etc/gitlab/gitlab.rb.

To update, add the time zone that best applies to your location. Here are two examples:

gitlab_rails['time_zone'] = 'America/New_York'


gitlab_rails['time_zone'] = 'Europe/Brussels'

After you added this field, reconfigure and restart:

gitlab-ctl reconfigure
gitlab-ctl restart
timezone  gitlab  configfile  solution 
october 2017 by kme
webpack-simple/webpack.config.js at master · vuejs-templates/webpack-simple · GitHub
devServer: {
historyApiFallback: true,
noInfo: true
performance: {
hints: false
devtool: '#eval-source-map'
vuejs  javascript  webdevel  uglify  webpack  configfile  reference 
september 2017 by kme
Wildcards in entry points · Issue #370 · webpack/webpack · GitHub
You can easily do this by your own, as the webpack.config.js is just a node.js module and allows to execute any code.

var glob = require("glob");
// ...
entry: glob.sync("./test/**/*Spec.js")
webpack  configfile  bundling  webdevel  solution 
september 2017 by kme
How do I add comments to package.json for npm install? - Stack Overflow

This has recently been discussed in the node.js mailing list.

According to Isaac Schlueter who created npm:

... the "//" key will never be used by npm for any purpose, and is reserved for comments ... If you want to use a multiple line comment, you can use either an array, or multiple "//" keys.

{ "//": "this is the first line of a comment",
"//": "this is the second line of the comment" }

{ "//": [
"first line",
"second line" ] }
npm  package.json  configfile  webdevel  packagemanagement  commentcharacter  solution 
september 2017 by kme
Apache: Enable PHP in UserDir - Code Diary
The next step is enable the execution of PHP scripts inside public_html. To do that, as root, open the file /etc/apache2/mods-enabled/php5.conf and find the following lines:

<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine Off

On CentOS 6, doing this but specifying 'php_admin_value engine on' actually made the problem worse. Whatever problem I thought I had wasn't this.
apache  configfile  webmaster  debian  sortof  solution 
july 2017 by kme
mysql - Is it possible to have passwords configured per database or per host in .my.cnf - Database Administrators Stack Exchange
As I answered here, you can add a section for each user/host/db you connect to using the syntax in your ~/.my.cnf:

[clienthost1] # Note: client + host1

Once this is in your user's .my.cnf, you can utilize it by doing this on a command line:

$ mysql --defaults-group-suffix=host1
dba  mysql  configfile  solution 
june 2017 by kme
DavMail POP/IMAP/SMTP/Caldav/Carddav/LDAP Exchange Gateway - Frequently asked questions
To check this, try to connect to in your favorite web browser: you should get an authentication popup. On authentication success, you should get the EWS wsdl definition. If you don't, please contact the Exchange administrators to let them fix the broken Exchange server setup.

How do I detect errors in Thunderbird/Lightning calendar ?

Unfortunately, Lightning does not provide much feedback of what is going on. To detect errors at this level, you may activate calendar log settings under Tools/Options/Advanced:


Access another user mailbox

Either set base IMAP path in client settings to /users/ or use the following username: domain\user\ where it target mailbox name.
davmail  faq  configfile  exchange  ews  reference  solution 
may 2017 by kme
mozilla_sync causes lots of errors "user not found" in /etc/apache2/error.log · Issue #76 · owncloudarchive/mozilla_sync · GitHub
In the case of CentOS 6, you probably want to put this in /etc/httpd/conf.d/
Try the following:

<Location /owncloud>
AllowOverride All
Order allow,deny
Allow from all
apache  configfile  webmaster  owncloud  webdav  errormessage  solution 
may 2017 by kme
Ability to configure sidekiq concurrency · Issue #2780 · gitlabhq/gitlabhq · GitHub
See also:

P.S.: This doesn't really help with memory usage, so there's not much point.
at gitlab 8.16 installed with the omnibus package you can also control the number of concurrent sidekiq processes by editing the /etc/gitlab/gitlab.rb file. Just uncomment sidekiq['concurrency'] = 25 and alter.

As always, be sure to run gitlab-ctl reconfigure afterwards
(note: i've just installed the 8.16 package, i'm sure that it's also available in less current versions)
gitlab  sidekiq  configfile  memoryusage  sysadmin  solution 
may 2017 by kme
github - How to set a default username for HTTPS git push? - Stack Overflow

OK, git credentials can do this. Adding this to my git config fixed the problem:

[credential ""]
username = (MyUsername)

Note that git credentials is a relatively new feature in git, released in 1.7.9 or something, so it won't work in older versions.
git  cloneurl  credentials  configfile  annoyance  solution 
may 2017 by kme
Ubuntu 16.04 doesn't hibernate - Ask Ubuntu
I cloned a partition from one device to another and changed the UUID of the original swap partition, so hibernate didn't work anymore. The culprit is /etc/initramfs-tools/conf.d/resume. Even if you remembered to update /etc/fstab and do a new 'update-grub' this is the last thing you need to update if any of your drive letters' UUIDs were changed (intentionally or unintentionally).

The 'resume=' option isn't required (somehow it's given to the kernel by the initramfs environment). The "pci=nomsi" kernel option looks interesting (but didn't change anything on the VAIO VGC-JS110J).
ubuntu  hibernate  powermanagement  configfile  fuckina  solution  vgcjs110j 
may 2017 by kme
[SOLVED] Can We Have Grub2 simpy ignore a 2nd drive?
OSPROBED="`os-prober | grep /dev/sdb | tr ' ' '^' | paste -s -d ' '`"
linux  ubuntu  grub  configfile  solution 
may 2017 by kme
« earlier      
per page:    204080120160

related tags

acceleration  accesscontrol  alias  aliases  almostsolution  alternativeto  altkeymap  annoyance  annoyancesortof  ansible  antialiasing  apache  api  apiary  appinfo.ini  arch  authentication  autocmd  autocomplete  autocompletion  autohotkey  autojump  automation  autostart  awk  backup  backupandrecovery  bash  bashcompletion  bashrc  bestpractice  bestpractices  binary  blog  boost  boot  bootmanager  bootup  boris  buffers  bug  build  bundling  butwhy  c  capslock  cargo  cchmc  centos  centos6  cgi  cheatsheat  cheatsheet  chezscheme  cifs  clang  classicgaming  cli  cling  cloneurl  cluster  cm  colors  colorscheme  comandline  commandline  commentcharacter  comments  compilation  compiler  completion  composer  concurrency  conffile  config  configfile  configini  configparser  configsetting  configsettings  configuration  confusing  console  consolefont  continuationcharacter  conversion  converter  cpan  cplusplus  crashrecovery  credentials  crlf  crossplatform  ctrl-r  custombuild  customization  dammitbrain  database  datamunging  davmail  dba  debian  debugger  debugging  debuging  defaults  defaultswrite  deployment  deprecation  devel  devops  diff  dircolors  distributed  distro  docker  dockerfile  documentation  dosbox  dotfile  dotfiles  dotgitconfig  dualboot  eclipse  editor  el  elementary  elementaryos  emacs  email  embedded  encryption  environment  environmentvariables  errormessage  essential  ews  example  examples  exchange  explained  eyecandy  faq  fedora  fileformat  filetype  finder  fish  flask  fonts  forreference  framebufferconsole  fuckina  functionkeys  gcc  gdb  geary  generator  getty  gimp  git  gitattributes  gitfu  gitlab  gitrebase  gnome  gnome-keyring  gnome-terminal  gnome3  gnustow  go  gpg  graphics  grub  grub2  gtk  gtkrc  gvim  handlers  hardstatus  hibernate  hiddenfiles  hiresconsole  history  historysearch  homesick  hook  hostfile  hosting  hotkey  hotkeys  howto  htaccess  httpd  https  ide  idle  iis  importexport  incantation  ini  inifile  init  initsystem  input  inputoutput  inputrc  intellisense  interactivemode  ipython  irb  iterm  java  javascript  jdk  jessie  jinja2  jre  json  jvm  kernel  keybinding  keybindings  keyboard  keyboardshortcuts  keymapping  keymappings  keyring  language  launchd  ldap  ldso  less  libedit  library  lighttable  linedrawcharacters  lineends  linter  linux  listserv  logging  logrotation  logs  mac  macos  macports  macros  macvim  magickeys  mailinglist  maintenance  make  management  mapping  maybe  maybesolution  mc  mediawiki  memoryusage  minimalist  mlm  modeline  module  modulefile  modules  mod_rewrite  mod_wsgi  mountainlion  movein  msoffice  mta  multiplexor  mutt  mysql  mysqldump  nano  nautilus  needshelp  nerdtree  networking  newbie  newline  nginx  nih  nodejs  nopeyoucant  notepad2  npm  omfg  openbox  openldap  optionsfile  osx  owncloud  package.json  packagemanagement  pager  parser  partial  passwordmanager  pcre  pep8  performancetuning  perl  photoshop  php  playbook  plugin  portableapps  portforwarding  post-receive  postfix  postman  postmaster  powermanagement  powershell  productivity  programming  prompt  promptstring  provisioning  proxy  proxying  ptpython  putty  python  quickfix  rails  rcfile  rcfiles  rcs  readline  readme  readynas  recommendations  redirect  reference  registers  registry  remoteaccess  remoteadministration  remotetracking  repl  repos  requiretty  resolveconf  rest  reverseproxy  revisioncontrol  rewriterules  rhel  rubout  ruby  rust  sample  samplecode  sampleconfig  scheme  scm  screen  script  scripts  searchandreplace  searching  security  selinux  serialization  settings  sharedlibrary  shell  shellenhancement  shellscripting  shortcutkeys  shorturl  sidekiq  slurm  smb  smtp  software  solution  sortof  sortofsolution  sourcetree  spacesvstabs  splits  ssh  sshtunnelling  ssl  startingfolder  startup  statusline  styleguide  submodule  substitution  subversion  sudo  svn  syntastic  syntax  syntaxchecker  syntaxhighlighting  sysadmin  sysadminc  sysctl  syslog  systemd  tabcompletion  tabs  tabstops  tdd  tempfiles  template  templatetoolkit  termcap  terminal  terminalemulator  terminalmultiplexor  terminfo  testing  textediting  texteditor  textprocessing  theme  timezone  tipsandtrick  tipsandtricks  tmux  toml  toolchain  tracking  transformation  transport  turingcomplete  tutorial  ubuntu  uglify  unix  urlrewriting  utility  uwsgi  vagrant  vagrantfile  variables  versioncontrol  vgcjs110j  vhost  vi  video  vikeybindings  vim  vimode  vimrc  virtualbox  virtualenv  virtualhost  virtualhosts  virtualization  virtualizationandemulation  vrapper  vue-resource  vuejs  watchthisspace  webapp  webdav  webdevel  webhosting  webmaster  webpack  websockets  whitespace  wiki  windowmaker  windowmanagement  windows  woes  wordpress  workaround  x11  xfce  xterm  xtermcolors  yaml  yourls  zhsrc  zsh  zshrc 

Copy this bookmark: