Add the following line to /etc/gai.conf
...
precedence ::ffff:0:0/96 100
... so that the system gives preference to IPv4, avoiding IPv6 timeout.
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
# https://www.digitalocean.com/community/questions/how-to-change-swap-size-on-ubuntu-14-04 | |
fallocate -l 4G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
swapon -s | |
sysctl vm.swappiness=10 | |
sysctl vm.vfs_cache_pressure=50 |
import React from 'react'; | |
import compose from 'recompose/compose'; | |
import classNames from 'classnames'; | |
import styles from './styles.scss'; | |
import pure from 'recompose/pure'; | |
const Timeline = ({className, children}) => { | |
const classes = classNames(className, styles.timeline); | |
return (<div className={classes}>{children}</div>); | |
}; |
Add the following line to /etc/gai.conf
...
precedence ::ffff:0:0/96 100
... so that the system gives preference to IPv4, avoiding IPv6 timeout.
/** | |
* Author: Richard Willis - badsyntax.co | |
* Example here: http://demos.badsyntax.co/places-search-bootstrap/example.html | |
* | |
* Please note: This is not a reliable method of geocoding the address. Using the | |
* PlacesService is a much better approach. View the example above for an example | |
* of using the PlacesService to geocode the address. | |
*/ | |
var service = new google.maps.places.AutocompleteService(); |
<?php | |
/** | |
* Total stops | |
* Execute the code at http://sandbox.onlinephpfunctions.com/code/98e0909b60bc2f1096961cc2a7be39efd7cab6cb | |
* @param array $A people weights | |
* @param array $B people destination floor | |
* @param int $M total floors | |
* @param int $X elevator's people capacity | |
* @param int $Y elevator's weight capacity | |
* @return int total stops |
Tested in Ubuntu Server 14.04
Installing java and maven3
sudo apt-add-repository ppa:andrei-pozolotin/maven3
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install maven3 oracle-java8-installer
#!/usr/bin/env bash | |
# This script install PhantomJS in your Debian/Ubuntu System | |
# | |
# This script must be run as root: | |
# sudo sh install_phantomjs.sh | |
# | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 |
########################################################################################################################### | |
### MISC ################################################################################################################## | |
########################################################################################################################### | |
# Replace string in multiple files | |
grep --include=filename -rl 'string_to_be_replaced' /directory | xargs sed -i 's/string_to_be_replaced/new_string/g' | |
# Remove git sensitive data | |
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch filename' --prune-empty --tag-name-filter cat -- --all |
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
describe 'App.HeaderModule', -> | |
beforeEach -> | |
@headerModule = window.App.HeaderModule | |
it 'should exist', -> | |
expect(@headerModule).not.toBeUndefined() | |
describe 'starting', -> |