This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ xrandr -d :0 --output DVI1 --right-of VGA1 | |
X: ../../../src/sna/kgem.c:4173: kgem_create_2d: Assertion `size && size <= kgem->max_object_size' failed. | |
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" | |
after 38 requests (38 known processed) with 0 events remaining. | |
[ 42.911] | |
X.Org X Server 1.15.1 | |
Release Date: 2014-04-13 | |
[ 42.911] X Protocol Version 11, Revision 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Failure with xrandr when TearFree is enabled | |
xrandr -d :0 --output LVDS1 --off | |
xrandr -d :0 --output TV1 --off | |
xrandr -d :0 --output VIRTUAL1 --off | |
xrandr -d :0 --output VGA1 --off | |
xrandr -d :0 --output DVI1 --off | |
xrandr -d :0 --output VGA1 --mode 1920x1080 --refresh 60 --rotation normal | |
xrandr -d :0 --output DVI1 --mode 1920x1080 --refresh 60 --rotation normal | |
xrandr -d :0 --output DVI1 --right-of VGA1 # FAILS HERE with: “Configure crtc 1 failed” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Desired=Unknown/Install/Remove/Purge/Hold | |
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend | |
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) | |
||/ Name Version Architecture Description | |
+++-===============================-====================-====================-=================================================================== | |
ii accountsservice 0.6.35-0ubuntu7.1 i386 query and manipulate user account information | |
ii acl 2.2.52-1 i386 Access control list utilities | |
ii adduser 3.113+nmu3ubuntu3 all add and remove users and groups | |
ii apparmor 2.8.95~2430-0ubuntu5 i386 User-space parser utility for AppArmor | |
ii apt 1.0.1ubuntu2.1 i386 commandline package manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
class Base | |
class << self | |
delegate :pluck, :ids, :to => :scoped | |
end | |
end | |
class CollectionProxy | |
delegate :pluck, :ids, :to => :scoped | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to expand a volume | |
1) Add new disk to the VM | |
2) Ensure it shows up as a device | |
3) fdisk /dev/____ | |
4) add a partition (primary?) | |
5) sudo pvcreate /dev/____ | |
6) sudo pvs # get name of volume group | |
7) sudo vgextend NAME_OF_VOLUME_GROUP /dev/____ | |
8) sudo lvextend -l+100%FREE /dev/NAME_OF_VOLUME_GROUP/root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use tcpdump to monitor mysql | |
# Capture the packets | |
sudo tcpdump -i eth0 port 3306 -s 65535 -x -n -q -tttt > tcpdump.out | |
# analyze all the requests from a given host | |
pt-query-digest --type=tcpdump --filter '($event->{host} || $event->{ip} || "") =~ m/192.168.248.64/' tcpdump.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
class Base | |
# Define a method that can be called on an ActiveRecord::Base class | |
# or on a Scope object. This will call the db-adapters select_and_yield | |
# to perform the query and yield back each row found. Each row is then | |
# instantiated into an object and yielded to the caller. | |
def self.yield_all(*args) | |
raise "Must supply block" unless block_given? | |
options = args.extract_options! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 004 | |
sorted_rates = rates.select { |rate| rate.from != 'USD' }. | |
sort { |a, b| a.from <=> from_cur }. | |
map { |rate| [rate] } | |
# Split the select into two? less efficient but "single responsibility" ? | |
all_paths(sorted_rates).select { |rates_arr| rates_arr.first.from == from_cur && rates_arr.last.to == 'USD' }. | |
sort { |a, b| a.length <=> b.length }. | |
first | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def py_slice(start, step = 1) | |
start.step(step < 0 ? 0 : self.length, step).map { |index| self[index] } | |
end | |
end | |
input = ARGF.readlines | |
for i in Range.new(0,input.size).step(4) | |
northLasers, conveyorBelt, southLasers = input[i,3] |