Skip to content

Instantly share code, notes, and snippets.

View abelardojarab's full-sized avatar

Abelardo Jara-Berrocal abelardojarab

View GitHub Profile
@abelardojarab
abelardojarab / fix_sphinx_environment.md
Last active November 14, 2017 00:33
Fix sphinx environment.py; needed when sphinx complains about number of arguments to find_files

Locate find_files line and modify it to match:

        def find_files(self, config, builder=None)

Also search for the lines where find_files is invoked; and assure we have a second argument (None)

@abelardojarab
abelardojarab / buffer_modified_flag_emacs.md
Created November 17, 2017 18:03
Who is setting the buffer modified flag in Emacs

So, most of the code that sets text-properties needs to be careful to reset the modified-p flag afterwards. The best way to do that is usually by wrapping the code that sets the properties inside a with-silent-modification.

One way try to track down the culprit is by trying to undo the modification (e.g. with C-z), but of course, if the modification is not visible, undoing it won't be visible either. So instead you may want to look at C-h v buffer-undo-list RET which is the internal data used to keep track of the modifications. With luck, not only was the modified-p set but the undo-list as well, and that list will tell you what was changed. For example, that list could look like (nil (nil face nil 12345708 . 12345713)) which means that the change was to set the face property to a new value between positions 12345708 and 12345713 and that the old value of that property was nil (that's the 3rd nil in the above). Sometimes looking at the affected positions with M-: (goto-char 12345708) RET is sufficient to fi

@abelardojarab
abelardojarab / kill_chrome_chromium.md
Created November 18, 2017 17:06
How to kill chrome or chromium and all its instances from command line

The answer is:

pkill chrome

or

pkill chromium
@abelardojarab
abelardojarab / fix_code_not_launching_vnc.md
Last active December 17, 2017 00:21
Fix Visual Studio not launching under vncserver

There is a much cleaner workaround that won't break other apps:

# make a copy of the relevant library
mkdir ~/lib
cp /usr/lib/x86_64-linux-gnu/libxcb.so.1 ~/lib
sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' ~/lib/libxcb.so.1
# set the dynamic loader path to put your library first before executing VS Code
LD_LIBRARY_PATH=$HOME/lib code
@abelardojarab
abelardojarab / dkms_rebuild_all.sh
Created December 20, 2017 17:49
Command to rebuild all DKMS modules for all installed kernels
#!/bin/bash
ls /var/lib/initramfs-tools | \
sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start
@abelardojarab
abelardojarab / install_dkms_module.md
Created December 20, 2017 17:50
Install a DKMS module usind dkms.conf file
$ wget http://tenet.dl.sourceforge.net/project/e1000/ixgbe%20stable/4.3.15/ixgbe-4.3.15.tar.gz
$ sudo tar -xf ixgbe-4.3.15.tar.gz -C /usr/local/src
$ sudo mv /usr/local/src/ixgbe-4.3.15/src /usr/src/ixgbe-4.3.15

Create the following dkms.conf file under this directory as follows.

$ sudo vi /usr/src/ixgbe-4.3.15/dkms.conf
@abelardojarab
abelardojarab / no_kde_wallet_for_google_chrome.md
Created December 26, 2017 22:15
Force Google Chrome to not use kde-wallet
$ sudo gedit /usr/share/applications/google-chrome.desktop

All you need is to find out the line starts with Exec and add as follows:

google-chrome-stabe --password-store=basic %U
@abelardojarab
abelardojarab / build_emacs_lucid_toolkit.md
Last active January 9, 2018 07:20
Build Emacs with Lucid toolkit
./configure --with-xft --with-x-toolkit=lucid --enable-link-time-optimization --without-xwidgets
@abelardojarab
abelardojarab / enable_native_notifications_chrome.md
Created January 9, 2018 18:55
Enable native notifications for Google Chrome

Assuming you’re running the latest dev channel release (check Software Updater if you’re not sure) you just need to head to the following URL in a new tab:

chrome://flags/#enable-native-notifications

Click the toggle menu button thing and select “Enabled“.

@abelardojarab
abelardojarab / convert_markdown_to_pdf_with_css.md
Created January 10, 2018 01:37
convert Markdown to PDF using stylesheet (.css)

Install globally to use from the command line.

npm install mdpdf -g

Example usage:

mdpdf README.md - Simple convert using GitHub Markdown CSS and some additional basic stylings.