recentpopularlog in

kme : workaround   103

« earlier  
html - Can I nest a <button> element inside an <a> using HTML5? - Stack Overflow
No. But I ended up using a variation of https://stackoverflow.com/a/28665849/785213, which sets 'onclick="location.href='#anchor'"' instead, then an 'a' element inside as a backup if JS is disabled.
webdevel  html5  button  links  workaround  solution 
5 weeks ago by kme
#927669 - nvpy: could not connect to simplenote server - Debian Bug report logs | https://bugs.debian.org/
This is the standard 'nvpy' package in Ubuntu 18.04. The reason is because 1.0.0 uses the retired Simplenote API. RIP.

Solution is to install it with pip3.
nvpy  debian  ubuntu  simplenote  bug  workaround 
10 weeks ago by kme
javascript - Remove All Event Listeners of Specific Type - Stack Overflow
I ended up binding to 'window.onscroll' and just set 'document.documentElement.scrollTop = 0' each time it fired, which is janky when there are a ton of scroll events queued.

But nothing else--neither 'e.preventDefault()' nor 'e.stopPropagation()'--seemd to work.
webdevel  javascript  eventhandler  mousewheel  scrolling  sortof  workaround  solution 
december 2019 by kme
linux - How to get CMake to use the default compiler on system PATH? - Stack Overflow
As is already written in the answer to the other question, CMake prefers the generic compiler names cc and c++ when searching for the C and C++ compilers. These probably refer to GNU version 4.1 compilers on your system.

Anyway, to force CMake to use the default compilers on the system path, add the following code to the beginning of your outermost CMakeLists.txt.
<code class="language-cmake">find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH)
...
project (Foo C CXX)</code>
The find_program calls must occur before the call to project or enable_language.
cmake  build  toolchain  annoyance  workaround 
december 2019 by kme
mdh34/elementary-indicators: An unofficial guide to restore indicator functionality on elementary OS | https://github.com/
All that seems to be required for most (exception of gtk2) indicators is

- install 'indicator-application' from the repos
- then the old wingpanel-ayatana-indicator package (https://launchpad.net/~elementary-os/+archive/ubuntu/stable/+files/wingpanel-indicator-ayatana_2.0.3+r27+pkg17~ubuntu0.4.1.1_amd64.deb)
- and follow the instructions from https://pinboard.in/u:kme/b:bc95dba3fa3c to customize its XDG .desktop file so it runs in Pantheon

That is:
Edit /etc/xdg/autostart/indicator-application.desktop:
<code class="language-bash">sudo vim /etc/xdg/autostart/indicator-application.desktop</code>
change:
<code class="language-ini">OnlyShowIn=Unity;GNOME;</code>
to
<code class="language-ini">OnlyShowIn=Unity;GNOME;Pantheon;</code>
and 'killall wingpanel'.

Also of note:
If you copy the file to .config/autostart/indicator-application.desktop then you shouldn't have to worry about it getting overwritten again.
elementaryos  wingpanel  panel  indicator  notification  systray  workaround  appindicator  notificationarea  solution  fuckina 
november 2019 by kme
Cygwin no available download site - Stack Overflow
Solution for me (modern.ie Win7 VM on corporate network) was to go to https://cygwin.com/mirrors.html and pick one of the mirrors from there.
cygwin  windows  corporatenetwork  mirrors  networksettings  annoyance  workaround  solution 
october 2019 by kme
python - make pip ignore an existing wheel - Stack Overflow
Has this problem with python-levenshtein being built with UCS-4 symbols and my homebrew Python was only UCS-2. This totally did the trick. See also: https://bytes.com/topic/python/answers/34496-undefined-symbol-pyunicodeucs4_fromunicode

<code class="language-bash">pip install <package> --no-binary :all:</code>
pip  wheel  binary  workaround  solution 
september 2019 by kme
Is there a CSS selector for elements containing certain text? - Stack Overflow
Not possible without JavaScript
<code class="language-javascript">
// using jQuery
$('td:contains("male")')
</code>
css  selector  webdesign  webdevel  workaround  solution 
september 2019 by kme
windows - How do I use a pipe to redirect the output of one command to the input of another? - Stack Overflow
So it looks like you can't pipe the output of batch files into other programs with CMD.EXE, which I just... never noticed.

Workaround is to use PowerShell to run the whole pipeline, since it has proper pipes
You can also run exactly same command at Cmd.exe command-line using PowerShell. I'd go with this approach for simplicity...
<code class="language-powershell">PowerShell -Command "temperature | prismcom.exe usb"</code>

Please read up on Understanding the Windows PowerShell Pipeline

You can also type in C:\>PowerShell at the command-line and it'll put you in PS C:\> mode instanctly, where you can directly start writing PS.
windows  cli  cmd.exe  cmd  shellscripting  powershell  workaround  sortof  solution 
august 2019 by kme
cmd - How can you get the clipboard contents with a Windows command? - Stack Overflow
<code class="language-dos">powershell -command "Get-Clipboard" > file.txt</code>

This cannot be stored in a DOSKEY macro, because those can't be used in pipes.
windows  cmd  powershell  clipboard  cli  automation  pipes  workaround  sortof  solution 
august 2019 by kme
Add a quiet option to docker pull · Issue #13588 · moby/moby
And I can't get it on macOS 10.11, of course, but simply redirecting stderr or closing it works:
<code class="language-bash">docker run --rm bash:$tag bash -c "shopt | grep -q $option" 2>&-</code>
docker  cli  annoyance  workaround  solution 
august 2019 by kme
DBD::mysql - MySQL driver for the Perl5 Database Interface (DBI) - metacpan.org
Additionally, turning on this flag tells MySQL that incoming data should be treated as UTF-8. This will only take effect if used as part of the call to connect(). If you turn the flag on after connecting, you will need to issue the command SET NAMES utf8 to get the same effect.


This did *not* work as advertised, and I ended up setting it *after* the connect, along with 'SET NAMES', which actually *did* seem to fix the error messages I was getting about "COLLATION 'utf8_bin' is not valid for CHARACTER SET 'latin1'":

<code class="language-perl"># source https://www.gyford.com/phil/writing/2008/04/25/utf8-mysql-perl/
# see also: https://stackoverflow.com/a/6423280/785213
$dbh->{mysql_enable_utf8} = 1;
# $dbh->do('SET NAMES utf8');</code>
perl  dbi  dbd  mysql  dba  devel  reference  errormessage  workaround  solution 
august 2019 by kme
linux - Bash completion for path in argument (with equals sign present) - Stack Overflow
Check out the definition of COMP_WORDBREAKS in your environment to see why '--arg=<TAB>' (maybe) isn't working.
bash  programmablecompletion  tabcompletion  completion  maybesolution  workaround 
august 2019 by kme
bash - Wildcard expansion (globbing) in a string composed of quoted and unquoted parts - Stack Overflow
I had a variable that I was doing a regex comparison on within a Bash '[[ ]]' conditional that could /sometimes/ have the value of '*'; quoting didn't seem to help, but 'set -f' did.
bash  shellscripting  globbing  fileglobs  globs  workaround  solution 
august 2019 by kme
Issue 31652: make install fails: no module _ctypes - Python tracker
Had to build and install libffi into the PREFIX for Python-3.7.4 when building it from source on CentOS 7.

See also: https://bugs.python.org/issue34036
centos  centos7  fromsource  build  toolchain  compiler  errormessage  python  workaround  solution 
august 2019 by kme
Re: Lua and pkg-config .pc file | http://lua-users.org/
I was trying to build 'highlight' (https://gitlab.com/saalen/highlight) and got a 'lua.pc' not found error. This was the solution

<code class="language-bash">
make pc INSTALL_TOP=/wherever/you/stow/lua-5.3.5 > lua.pc
</code>

This was just an off-the-cuff answer from someone who probably doesn't know 'pkg-config' very well, though, because it *still* doesn't work unless you add 'Name:', 'Version:', and 'Description:' fields to the .pc file.

THEN, you can move that 'lua.pc' into '/wherever/you/stow/lua-5.3.5/lib/pkgconfig' and update the PKG_CONFIG_PATH environment variable.
lua  build  toolchain  errormessage  library  pkg-config  annoyance  workaround  solution 
july 2019 by kme
Force flushing of output to a file while bash script is still running - Stack Overflow
I found a solution to this here. Using the OP's example you basically run
<code class="language-bash">stdbuf -oL /homedir/MyScript &> some_log.log</code>

and then the buffer gets flushed after each line of output. I often combine this with nohup to run long jobs on a remote machine.
<code class="language-bash">stdbuf -oL nohup /homedir/MyScript &> some_log.log</code>

This way your process doesn't get cancelled when you log out.
bash  shellscripting  buffering  annoyance  workaround  solution 
june 2019 by kme
How can I disable searching and domain guessing from the Firefox Address Bar, while keeping other features? - Super User | https://superuser.com/
The settings mentioned in the accepted answer will prevent, for example, 'localhost' from redirecting to 'localhost.com', but this still doesn't stop Firefox from trying to visit a non-existent web site if your search term has a period in it. So a search like "vcruntime140.dll" will still assume that ".dll" is a TLD.

However, I blindly discovered that putting a "?" at the beginning of the query is enough to turn of hostname detection, and pressing Ctrl+K will do that, and focus the Awesome Bar for you.

See also: https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly#w_search and https://support.mozilla.org/en-US/kb/awesome-bar-search-firefox-bookmarks-history-tabs#w_how-can-i-control-what-results-the-address-bar-shows-me (section called "Changing results on the fly").
Go to about:config and set the following preferences to false:

browser.fixup.alternate.enabled

True (default): Try to fix up http://foo to http://(prefix)foo(suffix)
False: Do not second-guess the user
firefox  search  awesomebar  configsetting  annoyance  url  toosmart  solution  configuration  customization  movein  sortof  workaround 
april 2019 by kme
regro/conda-metachannel: like a conda-metapackage but for channels! | https://github.com/
like a conda-metapackage but for channels! Contribute to regro/conda-metachannel development by creating an account on GitHub.

Via: https://github.com/conda/conda/issues/7239
conda  conda-forge  bandaid  itsslow  workaround  maybesolution 
march 2019 by kme
ERROR : Base home directory does not exist within the container - Google Groups | https://groups.google.com/
This worked for me, but the kernel on our cluster is too old:

<code class="language-bash">
singularity shell --no-home docker://centos:7
</code>
singularity  errormessage  workaround  solution 
march 2019 by kme
man command not found on git bash · Issue #249 · swcarpentry/shell-novice | https://github.com/
man doesn't seem to be installed on git bash - learners get a "man: command not found" error when they try to use it.
softwarecarpentry  git  gitforwindows  bash  annoyance  packagemanagement  workaround  solution 
february 2019 by kme
dns - Network calls fail during image build on corporate network - Stack Overflow | https://stackoverflow.com/
I was able to figure out the issue. On Ubuntu, Docker sets the DNS servers for container to Google's servers at 8.8.8.x. As I understand it, this is a workaround on Ubuntu due to the fact that Ubuntu sets /etc/resolv.conf to be 127.0.0.1.

Those Google servers weren't accessible from behind our firewall, which is why we couldn't resolve any URLs.

The fix is to tell Docker which DNS servers to use. This fix depends on how you installed Docker:
Ubuntu Package

If you have the Ubuntu package installed, edit /etc/default/docker and add the following line:
<code class="language-bash">
DOCKER_OPTS="--dns <your_dns_server_1> --dns <your_dns_server_2>"
</code>

You can add as many DNS servers as you want to this config. Once you've edited this file you'll want to restart your Docker service:
<code class="language-bash">
sudo service docker restart
</code>
docker  dns  corporatenetwork  bullshit  workaround  fuckina  solution 
february 2019 by kme
python - No module named pkg_resources - Stack Overflow | https://stackoverflow.com/
None of these worked.

What I ended up doing was:

<code class="language-bash">
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user
rm ~/.local/bin/pip # so the distro pip for Python 2.7 takes precedence
</code>
python  errormessage  annoyance  packaging  pip  ubuntu  16.04  workaround  solution 
february 2019 by kme
In AWK, is it possible to specify "ranges" of fields? - Stack Overflow | https://stackoverflow.com/
The answer is "no"; AWK does not support ranges of subscripts like Perl or Python slices.
unix  shellscripting  awk  syntax  newbie  workaround  solution 
january 2019 by kme
Check and verify md5/sha1/sha256 checksums for MacOS X when I download files - nixCraft | https://www.cyberciti.biz/
The solution is to check `uname -s` == "Darwin" and use `shasum -a 1` instead of `sha1sum`, which only exists on Linux
mac  osx  macos  security  checksum  hash  sha1  workaround  solution 
january 2019 by kme
sh - Check if a file exists with wildcard in shell script - Stack Overflow | https://stackoverflow.com/
You can do the following:
<code class="language-bash">
set -- xorg-x11-fonts*
if [ -f "$1" ]; then
printf "BLAH"
fi
</code>

This works with sh and derivates: ksh and bash. It doesn't create any sub-shell. $(..)and `...` commands create a sub-shell : they fork a process, and they are inefficient. Of course it works with several files, and this solution can be the fastest, or second to the fastest one.

It works too when there's no matches. There isn't need to use nullglob as one of the comentatators say. $1 will contain the origintal test name, therefore the test -f $1 won't success, because the $1 file doesn't exist.
bash  glob  wildcard  pitfall  gotcha  workaround  solution 
december 2018 by kme
CRAN - Package httpuv
There's no binary for httpuv-1.4.5 for R 3.3.3. So if you have a too-old RStudio on Windows, you won't be able to use shiny-1.2.0 (latest as of November 2018).

Workaround: install Windows / R 3.3.x shiny_1.0.5.zip (binary) from https://cran.r-project.org/bin/windows/contrib/3.3.
r  shiny  rshiny  dependencyhell  ihadthisproblem  workaround  solution  annoyance 
november 2018 by kme
install - Error in R: (Package which is only available in source form, and may need compilation of C/C++/Fortran) - Stack Overflow
There were two good ideas here: 1) using Rtools (https://cran.r-project.org/bin/windows/Rtools/); and 2) using binaries from https://cran.r-project.org/bin/windows/contrib/3.3.

What I ended up doing to solve this problem (shiny-1.2.0 w/ R 3.3.3 on Windows required httpuv-1.4.5, but only 1.4.1 was available as a binary for R 3.3.x on CRAN), was to download the Windows binary shiny_1.0.5zip from the URL in #2 above.

install.packages("https://cran.r-project.org/bin/windows/contrib/3.3/stringi_1.1.1.zip", repos =NULL)
r  rstudio  shiny  packagemanagement  errormessage  sortof  workaround  solution 
november 2018 by kme
How do I compile Readline support into Ruby - Stack Overflow | https://stackoverflow.com/
This is *NOT* work for me. I ended up using 'libedit' instead, after much exasperation, trials, and tribulations.
ruby  readline  compiler  build  toolchain  fromsource  headache  workaround  solution 
november 2018 by kme
Editline Library (libedit) - Port of NetBSD Command Line Editor Library | http://thrysoee.dk/
ncurses is required for libedit (which is required when you can't get Ruby 2.5.something to build with readline).

In order to build libedit successfully, you either need to have your ncurses headers in the $PREFIX/include directory, or explicitly give CFLAGS *and* CPPFLAGS a '-I/path/to/your/include/ncurses', because ncurses itself puts its headers in a 'ncurses' subdirectory.

The 'CPPFLAGS' one was surprise to me, but if you don't you get this error message while './configure' runs:
<code>checking ncurses.h presence... no
configure: WARNING: ncurses.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: ncurses.h: proceeding with the compiler's result</code>
build  toolchain  headache  annoyance  workaround  solution  errormessage  lib 
november 2018 by kme
How to pass password to mysql command line - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
It doesn't look like you can send a password to 'mysql' on stdin, even though that's where it seems to be expecting it from with the '-p' (no password) option.

So I ended up using the '--defaults-file' option.

Another thing to note is that if the password is blank (null), it looks like you have to use '--password=', because '-p' has no way of knowing that you are giving it a blank password (the shell eats the quoted empty string).
mysql  cli  dba  commandline  pipes  subprocess  python  workaround  solution 
november 2018 by kme
Index of /bin/linux/ubuntu | https://cran.r-project.org/
Some people have reported difficulties using this approach. The issue is usually related to a firewall blocking port 11371. If the first gpg command fails, you may want to try (thanks to Mischan Toosarani for the tip):
<code class="language-bash">
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
</code>

and then feed it to apt-key with
<code class="language-bash">
gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add -
</code>

Another alternative approach is to search for the key at http://keyserver.ubuntu.com:11371/ and copy the key to a plain text file, say key.txt. Then, feed the key to apt-key with
<code class="language-bash">
sudo apt-key add key.txt
</code>
r  installation  ubuntu  packages  keyserver  errormessage  workaround  solution 
november 2018 by kme
gnu make - makefile: concatenate text with infix operator - Stack Overflow | https://stackoverflow.com/


Louis is correct: there's no magical way of doing this. But if, instead of trying to remove the last item or treat it specially, you instead treat the first item specially, the work is much simpler to understand (I think); you can create a function combine that takes two arguments: the first is the text to put between the words and the second is a space-separated list of words to combine:
<code class="language-makefile">combine = $(word 1,$2) $(foreach W,$(wordlist 2,$(words $2),$2),$1 $W)</code>

Now you can use it like this:
<code class="language-makefile">$(call combine,-o,$(EXCLUDE_LIST))</code>

to get output like:
<code class="language-">$(BASE_DIR)/aaa* -o $(BASE_DIR)/bbb*</code>
devel  build  toolchain  makefile  stringfunctions  workaround  solution 
november 2018 by kme
macos - Case-insensitive ls sorting in Mac OSX - Ask Different | https://apple.stackexchange.com/
I needed sort's '-V' (version string sort) option, and here's how I got that:
Install the GNU Coreutils package:

sudo port install coreutils
sorting  textprocessing  bsd  mac  osx  shellscripting  workaround  solution 
november 2018 by kme
bash - .inputrc TAB not behaving as expected - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
Readline doesn't know anything about a modifier called Shift, and quietly ignores unknown modifier names. Try wibble-TAB.
unix  bash  readline  inputrc  annoyance  workaround  solution 
november 2018 by kme
linux - Rearrange columns using cut - Stack Overflow | https://stackoverflow.com/
'cut' can't, use AWK:
Use awk instead:
<code class="language-bash">awk '{ print $2 " " $1}' file.txt</code>
unix  textprocessing  csv  tabdelimited  annoyance  workaround  solution 
october 2018 by kme
Thunderbird inserts line breaks in sent HTML that break code lines · Issue #130 · adam-p/markdown-here · GitHub | https://github.com/
Leave the white-space:pre-wrap style in the default CSS. Tell people that the Tbird workaround is to remove that style from their CSS in the MDH options. Someday the Tbird fix will be released.

So just comment out `white-space:pre-wrap` in the settings.
markdownhere  thunderbird  markdown  bug  annoyance  workaround  solution  fuckina 
october 2018 by kme
Rcpp installation error - '::Rf_pythag' - General - RStudio Community | https://community.rstudio.com/
Got the error message
/usr/lib64/R/library/Rcpp/include/Rcpp/Rmath.h:222: error: ‘::Rf_pythag’ has not been declared

when attempting to install/upgrade the 'htmltools' package from CRAN.

This seems to be an effective workaround:
<code class="language-r">install.packages("https://mran.microsoft.com/snapshot/2018-06-01/src/contrib/Rcpp_0.12.17.tar.gz",repos = NULL, type = "source")</code>

Try also:
<code class="language-r">update.packages(ask = FALSE, checkBuilt = TRUE)</code>

Update 2019-11-25: also fixed the problem with https://github.com/aryeelab/DNAlandscapeR.
r  packagemanagement  annoyance  centos  sysadmin  solution  errormessage  workaround 
august 2018 by kme
How to break out of multiple loops in Python? - Stack Overflow | https://stackoverflow.com/
The first recommendation is to restructure everything so that you can just 'return', and in most circumstances, I agree with that.

However, PEP 3136's (https://www.python.org/dev/peps/pep-3136/) suggestion of wrapping the inner 'for' loop in a 'try:' with a 'break' in the 'except' clause also works nicely.

If, for some reason, the terminating conditions can't be worked out, exceptions are a fall-back plan.
<code class="language-python">class GetOutOfLoop( Exception ):
pass

try:
done= False
while not done:
isok= False
while not (done or isok):
ok = get_input("Is this ok? (y/n)")
if ok in ("y", "Y") or ok in ("n", "N") :
done= True # probably better
raise GetOutOfLoop
# other stuff
except GetOutOfLoop:
pass</code>
python  goto  exceptions  iteration  workaround  solution 
march 2018 by kme
Mechanics of Flite - Hash-based workarounds for MySQL unique constraint limitations | http://mechanics.flite.com/
In the past I have written about MySQL’s limitations that prevent you from creating an index over a certain length, or with more than a certain number of columns. I’ve offered some solutions for those problems, but many of my solutions hit another limit further down the line. For example innodb_large_prefix allows you to create an index on larger columns, but only up to 3072 bytes, and my workarounds for the 16 column limit per index will also hit that 3072 byte limit once you add lots of columns or add some very long columns.
mysql  indexing  primarykey  workaround  dba  webdevel  devel  solution 
march 2018 by kme
GitHub - abrookins/WrapToColumn: an Intellij/PyCharm/RubyMine etc. plugin that wraps selected text to the column width setting | https://github.com/
This plugin wraps text to a maximum line width, as defined in the section "Setting the maximum line width." It is intended as a replacement for the gq command in Vim and fill-paragraph in Emacs.
vikeybindings  intellij  pycharm  extension  plugin  keybinding  workaround  solution 
march 2018 by kme
nagative aurument in converter.rb:417 · Issue #12 · ttscoff/mdless | https://github.com/
I got this error without having 'pygmentize' installed:

<code>$ mdless --width=80 README.md
/Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:428:in `*': negative argument (ArgumentError)
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:428:in `block (2 levels) in convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:424:in `map'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:424:in `block in convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:404:in `gsub!'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:404:in `convert_markdown'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:118:in `block in initialize'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `each'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `initialize'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/bin/mdless:17:in `new'
from /Users/username/.gem/ruby/2.3.0/gems/mdless-0.0.10/bin/mdless:17:in `<top (required)>'
from /Users/username/.gem/ruby/2.3.0/bin/mdless:23:in `load'
from /Users/username/.gem/ruby/2.3.0/bin/mdless:23:in `<main>'</code>
markdown  viewer  errormessage  ruby  workaround  solution 
march 2018 by kme
command line - Markdown Viewer - Unix & Linux Stack Exchange | https://unix.stackexchange.com/
Brett Terpstra's 'mdless' is still prettier, and it's as easy as a 'gem install mdless'.
markdown  terminal  commandline  cli  viewer  workaround  solution 
march 2018 by kme
python - Does PyCharm support Jinja2? - Stack Overflow | https://stackoverflow.com/
Yeah, you need the "pro" version for full support, but to some extent, you can just add the keywords for a new file type (Preferences -> General -> File Types) by yourself.
pycharm  intellij  idea  jinja  jinja2  syntaxhighlighting  sortof  workaround  solution 
february 2018 by kme
MySQL :: MySQL Workbench Manual :: 5.3.5 Remote Management | https://dev.mysql.com/
The "SSH login based management" is greyed out if the host is "localhost" or 127.0.0.1. Workaround: add an alias called something else ("dev.local", "localhoerst", whatever) to /etc/hosts. Voila!
dba  mysql  mysqlworkbench  annoyance  workaround  solution 
february 2018 by kme
Writing optional parameters within stored procedures in MySQL? - Stack Overflow | https://stackoverflow.com/
Optional Parameters are not yet supported on MySQL. I'm suggesting that you pass null value in your parameter and inside your stored procedure has an IF statement.
<code class="language-sql">
DELIMITER $$
CREATE PROCEDURE procName
(IN param VARCHAR(25))
BEGIN
IF param IS NULL THEN
-- statements ;
ELSE commands
-- statements ;
END IF;
END$$
DELIMITER ;</code>
dba  sql  mysql  syntax  workaround  solution 
january 2018 by kme
MySQL Bugs: #15975: Optional parameters support in stored procedures | https://bugs.mysql.com/
The workaround as mentioned here (https://stackoverflow.com/a/12652259) is to pass the "optional" parameter in as NULL and check 'is NULL' with an 'IF' statement inside the procedure.
dba  mysql  bug  watchthisspace  workaround 
january 2018 by kme
php - PCRE is compiled without UTF support - Stack Overflow | https://stackoverflow.com/
I didn't have this problem at all, but this SO thread has the best google juice for "grep: this version of PCRE is compiled without UTF support".

How I worked around it was to unset the LANG environment variable (mine was "de_DE.UTF-8").

How I worked around it the second time I ran into this was to remove the copy of the 'libpcre' library that had been compiled without UTF-8 support from the lab drive, because we use LD_LIBRARY_PATH in the login scripts (still, for the moment).
shellscripting  pcre  grep  errormessage  utf8  unicode  workaround  solution 
january 2018 by kme
c - GLib-GIO-ERROR**: No GSettings schemas are installed on the system - Stack Overflow | https://stackoverflow.com/
I ran into this problem when trying to using GNU Stow with two different GLib (elementaryOS) applications, which both provided their own 'gschemas.compiled'. My solution was to remove the existing one and run 'glib-compile-schemas /usr/local/share/glib-2.0/schemas'.
The problem is with the Glib schemas that apparently are not compiled on your system.

You need the glib-compile-schemas and find the glib-2.0/schemas directory which is located in /usr/share/glib-2.0/schemas, I don't know if it will be found in the same path within MinGW, but I don't see why it wouldn't, so you must execute the following command1

<code class="language-bash">
glib-compile-schemas /usr/share/glib-2.0/schemas/
</code>

and that will create a file gschemas.compiled so you need write permission, then the error will go away.
gnustow  stow  errormessage  gsettings  glib  gnome  elementaryos  workaround  solution 
january 2018 by kme
Bug #1596377 “Desktop takes a long time to initialize” : Bugs : elementary OS
Yup, seems like renaming (disabling) the file to at-spi-dbus-bus.desktop.disabled in /etc/xdg/autostart and the login delay no longer occurs
x  x11  elementaryos  annoyance  login  wm  desktopsession  workaround  solution 
january 2018 by kme
Ubuntu: Only works in debug mode · Issue #19 · wavexx/screenkey | https://github.com/
<code class="language-bash">
# it's set to "!@im=ibus" by default, but ibus-daemon isn't running
unset XMODIFIERS

# don't need this if you run the previous one
ibus-daemon -d -x

screenkey -d
</code>

See also: https://github.com/wavexx/screenkey/issues/56 and https://bugs.launchpad.net/elementaryos/+bug/1701010
ibus  inputmethod  screencasting  elementaryos  errormessage  solution  needshelp  bug  workaround 
january 2018 by kme
api token gets lost when deleting browser history · Issue #1 · lostsnow/pinboard-firefox · GitHub
I had to uncheck "Clear history when Nightly closes" and just select (in the cookies section) "Keep until: I close Nightly" instead. This keeps the cookies that you've made exceptions for.

Also, there's this bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1416219) that will automatically clear all local storage for WebExtensions--due to an overzealous DELETE FROM, I guess--if you check "Offline Website Data" under "Clear history when Nightly closes."

NB: It looks like the "Clear history when Nightly closes" deletes ALL cookies, even if you made exceptions for them under the settings for cookies. Kind of confusing.
pinboard  firefox  extension  localstorage  annoyance  workaround  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
Tilix: VTE Configuration
2. OR use a login shell

Enable the option in your Tilix Profile (under Preferences) to use a login shell, the screenshot below shows the option that needs to be checked.
tilix  terminix  vte  terminal  linux  annoyance  configsettings  workaround  maybesolution 
november 2017 by kme
command line - Running a .desktop file in the terminal - Ask Ubuntu
Workarounds from the relevant bug report (https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/378783):
I'm also suffering from this bug, so here's some workarounds I've found on the Internet.

SO suggests the following workarounds:
* gtk-launch foo opens foo.desktop
* exo-open [[path-to-a-desktop-file]...]
* hashbang: #!/usr/bin/env deskopen
* dex foo.desktop

Ref:
https://askubuntu.com/questions/5172/running-a-desktop-file-in-the-terminal
linux  filemanager  xdg-open  annoyance  bug  cli  commandline  workaround  solution 
november 2017 by kme
Git - git-ls-tree Documentation | https://git-scm.com/
You can use this on a commit hash to get the files, then <code>git cat-file -p <hash></code> or <code>git cat-file blob <hash></code> to get the contents of a file at a specific commit.

The easier way might be <code>git show <tree-ish></code> as mentioned explained at http://gitready.com/intermediate/2009/02/27/get-a-file-from-a-specific-revision.html.
git  workaround  sortof  solution 
november 2017 by kme
preference fails to open in Thunderbird ( Mac version ) · Issue #447 · adam-p/markdown-here · GitHub | https://github.com/
<code class="language-javascript">Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow('mail:3pane').document.getElementById('tabmail').openTab('contentTab', {contentPage: 'resource://markdown_here_common/options.html'})</code>
thunderbird  mac  osx  extension  markdown  workaround 
november 2017 by kme
Add a font option for the editor, and other note content · Issue #274 · Automattic/simplenote-electron - https://github.com/
As a workaround, especially for CJK users, edit Simplenote\resources\app\dist\app.js. Search the font style string (-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif;), and add or replace with your custom font name, for example 'Microsoft YaHei' .
editor  monospace  fixedwidth  font  annoyance  workaround  sortof  solution  needshelp 
october 2017 by kme
Rich’s sh (POSIX shell) tricks
Sometimes it’s necessary to put a string in a shell-quoted form, for instance if it needs to be expanded into a command that will be evaluated with eval, written into a generated script, or similar. There are several methods, but many of them fail if the string contains newlines. Here is a version that works:
<code class="language-bash">quote () { printf %s\\n "$1" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/" ; }</code>

This function simply replaces every instance of «'» (single quote) within the string with «'\''» (single quote, backslash, single quote, single quote), then puts single quotes at the beginning and end of the string. Since the only character whose meaning is special within single quotes is the single quote character itself, this is totally safe. Trailing newlines are handled correctly, and the single quote at the end doubles as a safety character to prevent command substitution from clobbering the trailing newlines, should one want to do something like:
<code class="language-bash">quoted=$(quote "$var")</code>

Counting occurrences of a character
<code class="language-bash">tr -dc 'a' | wc -c</code>

This will count the number of occurrences of the character “a”, by deleting all other characters. However, it’s not clear what tr -dc does when encountering noncharacter bytes in the input; POSIX is unclear on this matter and implementations likely differ. Foundational logicians will appreciate this as a practical real-world difficulty in working with set complements and the universal set.

Instead, try the following:
<code class="language-bash">tr a\\n \\na | wc -l</code>

The wc -l command counts the number of newline characters seen, so using tr to swap occurrences of “a” with newlines allows tr to count “a”s instead.
stupidtricks  posix  bash  bourne  shellscripting  workaround  reference  quoting  bourneshell 
september 2017 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read