All quoted.
Set up a package root in your homedir to hold the Node "global" packages:
$ NPM_PACKAGES="$HOME/.npm-packages"
$ mkdir -p "$NPM_PACKAGES"
Set NPM to use this directory for its global package installs:
$ echo "prefix = $NPM_PACKAGES" >> ~/.npmrc
Configure your PATH and MANPATH to see commands in your $NPM_PACKAGES prefix by adding the following to your .bashrc:
# NPM packages in homedir
NPM_PACKAGES="$HOME/.npm-packages"
# Tell our environment about user-ins...
The rendered font often depends on the local font your system provides, therefore you often find a rule like below in the computed style for an element:
font-family: Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif
This means if your system has a font named Menlo
, it will render the text with this font. Otherwise it will try Monaco
and so on. For the last two fallback options the system is free to use any monospace
font or if not present any serif
font. At lea...
When you receive a ZIP file from a Windows user, umlauts and other non-latin1 characters in filenames may look corrupt, and probably will be corrupt when extracting the ZIP file.
The reason is encoding: Such archives are probably using Codepage 850. I am serious, 1987 is calling.
Fortunately, the unzip
command can handle such files like so:
unzip -O CP850 file.zip
Interestingly enough, Rubyzip also compresses files that way. Probably so files look alright to Windows users.
Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due to a full /boot
partition, consider risizing it.
If you can't do the steps described below, ask someone experienced to help you out.
This has worked 100% so far. 1 out of 1 tries. ;)
When there is some unpartitioned space on your drive, increasing the size of /boot
is actually very easy (even though the list below is rather long). It only takes a...
The httpclient gem comes with a custom SSL cert store.
While an customizable, application-level cert store is great when you need to deal with broken or self-signed certificates, you usually want to use the cert store from the underlying Linux. The Linux cert store is updated periodically while httpclient's cert store goes out of date and will eventually not be able to verify certs.
To use the cert store from the underlying operating system:
client = HTTPClient.new
client.ssl_config.cert_store...
Your default postgres user is named like your linux user. That default user has limited access privileges, which can cause issues such as:
Doing these things without a superuser will show a Postgres error or (in Ruby) raise PG::InsufficientPrivilege
.
To do so, the application's PostgreSQL user must be a superuser. ...
If you want to make a screenshot of a website that works well in print or on a high-DPI screen (like Apple Retina displays), here is how you can capture a high-resolution screenshot.
You can do this without an addon:
CTRL +
and CTRL -
so it covers most of the window area. Leave a little padding on the left and right so...Let's say you have a folder images
and want to to move all files in there to a new subfolder public
.
cd images
mkdir public
mv !(public) public
The !(public)
excludes the new subfolder itself from being moved.
ImageMagick has a command line tool called identify
which can read image metadata:
>identify -verbose DSC00136.JPG
Image: DSC00136.JPG
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 5472x3648+0+0
Resolution: 350x350
Print size: 15.6343x10.4229
Units: PixelsPerInch
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 11...
run-one
is a wrapper script that won't run the given command while another instance of it is running. Is brings several utility commands that offer similar behavior.
NAME
run-one - run just one instance at a time of some command and unique set of arguments (useful for cronjobs, eg)
SYNOPSIS
run-one COMMAND [ARGS]
run-this-one COMMAND [ARGS]
run-one-constantly COMMAND [ARGS]
keep-one-running COMMAND [ARGS]
run-one-until-success COMMAND [ARGS]
run-one-until-failure COMMAND [ARGS]
...
Add the following to /etc/rc.local:
(sleep 3 && echo disable > /proc/acpi/ibm/bluetooth)&
Bluetooth icon will be active for a few seconds, then turn gray.
To create a 10 GB file:
fallocate -l 10G huge_file.dat
You can use three different versions of the regular expression syntax in grep
:
-G
-E
(POSIX)-P
(PCRE)Difference between basic and extended:
In basic regular expressions the meta-characters '?', '+', '{', '|', '(', and ')' loose their special meaning; instead use the backslashed versions '?', '+', '{', '|', '(', and ')'.
Difference between extended (POSIX) and perl (PCRE): E.g. \d
is not supported in POSIX.
This g...
This method will remove automatically installed packages that no other packages depend on any more. This, of course, includes obsolete kernel versions, with the explicit exception of the currently running kernel, the kernel version that was installed on the system before that and, of course, the latest updated version of the kernel. However, it will also remove any and all other packages that have been marked as installed automatically but have no other packages depending on them. This could lead to unexpected removal of package...
If your external displays not switching on or showing a weird behavior (for e.g. all displays getting the same configuration all the time) you can fix it by switching off all external displays and re-enabling only one in the first step. Afterwards you can apply your whole configuration via xrandr
. This behavior could be a bug in the kernel and may be fixed in linux 4.8.
Example display configuration
Screen 0: minimum 8 x 8, current 5760 x 1200, maximum 32767 x 32767
eDP1 connected 1920x1080+0+0 (normal left inverted right x axis...
When giving a presentation with a projector it is sometimes better to use a dual screen layout instead of a cloned display. If you still want a preview of the projector screen on your primary screen, you can do this:
Install x11vnc
and a vnc viewer (e.g. xtightvncviewer
).
Connect the projector.
In your system display settings, move the projector to the left or your primary screen (not strictly necessary, but I had weird clipping issues otherwise).
Start a vnc server for your second display with
x11vnc -clip xinera...
A few releases back, Chrome started using a Material Design UI on desktop. If you don't like it (on some window managers or GTK themes it's ugly), you can disable it.
Ctrl
+F
) for "Material Design"Chrome's default theme should now be pretty again.
On OSX (real or inside Browserstack), you need different keystrokes for your favorite special characters than you'd use on Linux or Windows.
Character | OSX Keystroke |
---|---|
[ |
Alt+5 |
] |
Alt+6 |
{ |
Alt+8 |
} |
Alt+9 |
` | ` (Pipe) |
\ (Backslash) |
Alt+Shift+7 |
@ |
Alt+L |
By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS.
You can use nmap
to find out what service is running behind a given port, and most often see some details about it. This can be helpful if servers don't offer the services you expect for some ports. If you'd like to see what ports are listing on your local machine, you might want to use netstat
instead of nmap
.
Note that nmap's service discovery may trigger several requests.
When using nmap, adding the -A
switch ...
So you downloaded a theme for Chrome a while ago and don't remember which one it is?
You can go to chrome://settings/appearance
(on Chrome 61+) to see the theme's name, and click a link to open it in the Chrome Web Store.
If you are on an older version, or if the above no longer works, you have to check Chrome's Preferences
file.
/home/YOUR_USER_NAME/.config/chromium/Default/Preferences
/Users/YOUR_USER_NAME/Library/Application Support/Google/Chrome/Default/Preferences
C:\Users\YOUR_US...
I had an issue with icons from an icon font aligning differently on Linux, iOS and Windows (seemingly browser-independent). With vertical-align:middle
, they aligned properly on Linux, iOS and macOS, whereas with a vertical-align
of -18%
, it looked good on Windows and iOS, but not Linux.
Further investigation showed that not only icons, but also normal capital letters aligned differently. No setting of vertical-align
could fix this, neither top
, bottom
, middle
, nor additional paddings or margins. It seems like browsers take the...
Processes in Linux might be put into Swap ("virtual memory") occasionally.
Even parts of a single process might be removed from memory and put into Swap.
In order to find out which processes remain within Swap, run this:
sudo grep VmSwap /proc/*/status | egrep -v "0 kB"
Keep in mind Swap is not evil by definition. Some bytes per process beeing put to Swap will not have that much of performance influence.
If you want the Linux virtual memory manager (which is responsible for the decision if and which processes are moved to Swap) to be...
Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing.
Here is a fix for that, tested on awesome 3.4, 3.5 and 4.0 (Ubuntu 14.04 and 16.04).
Consider the following:
Ctrl
+Shift
+N
If your mouse pointer hovers the file list, the main window is focused when the list is being replaced (or simply when it shrinks and your mouse pointe...
Chrome has discontinued support for 32-Bit Linux builds and this might break your apt-get update
.
To fix this, you need to update your APT source. This command does that automagically for you:
sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"
Note that if you are using a 32-bit Linux, you will no longer receive Chrome security updates and should switch to a different browser (maybe Chromium).