- Read every row in the table
- No reading of index. Reading from indexes is also expensive.
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
# Updated for Ruby 2.3 | |
string_t = None | |
def get_rstring(addr): | |
s = addr.cast(string_t.pointer()) | |
if s['basic']['flags'] & (1 << 13): | |
return s['as']['heap']['ptr'].string() | |
else: | |
return s['as']['ary'].string() |
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 use 'pci pass-through' to run Linux in Qemu accessing real Ath9k adapter | |
=============================================================================== | |
# Boot kernel with 'intel_iommu=on' | |
# Unbind driver from the device and bind 'pci-stub' to it | |
echo "168c 0030" > /sys/bus/pci/drivers/pci-stub/new_id | |
echo 0000:0b:00.0 > /sys/bus/pci/devices/0000:0b:00.0/driver/unbind | |
echo 0000:0b:00.0 > /sys/bus/pci/drivers/pci-stub/bind |
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 Where | |
class <<self | |
attr_accessor :editor | |
def is_proc(proc) | |
source_location(proc) | |
end | |
def is_method(klass, method_name) | |
source_location(klass.method(method_name)) |
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
#!/bin/bash | |
mkdir wordpress-site && cd wordpress-site | |
touch docker-compose.yml | |
cat > docker-compose.yml <<EOL | |
version: "2" | |
services: | |
my-wpdb: |
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 calculate postgreSQL database size in disk ? */ | |
SELECT pg_size_pretty(pg_database_size('thedbname')); | |
/* Calculate size of a table including or excluding the index */ | |
SELECT pg_size_pretty(pg_total_relation_size('big_table')); | |
SELECT pg_size_pretty(pg_relation_size('big_table')); /* without index */ | |
/* See indexes on a table with `\d tablename` */ |
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
#!/bin/sh | |
# Typical location - /jffs/scripts/ddns-start | |
# NOTE - USERNAME and PASSWORD must be URL encoded, example @ becomes %40 | |
USERNAME=CHANGE_ME_URL_ENCODED | |
PASSWORD=CHANGE_ME_URL_ENCODED | |
HOSTNAME=all.dnsomatic.com | |
IP=`curl --silent http://canhazip.com` | |
# Should be no need to modify anything beyond this point | |
/usr/sbin/curl --silent "https://$USERNAME:[email protected]/nic/update?hostname=$HOSTNAME&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG&myip=$IP" > /dev/null |
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
***** 304-hardened.patch ***** | |
PWD: /var/tmp/portage/app-emulation/vmware-modules-304.2/work | |
PATCH TOOL: patch -> /usr/bin/patch | |
VERSION INFO: | |
GNU patch 2.7.5 | |
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. | |
Copyright (C) 1988 Larry Wall | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
This is free software: you are free to change and redistribute it. |
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
***** 308-hardened.patch ***** | |
PWD: /var/tmp/portage/app-emulation/vmware-modules-308.0-r1/work | |
PATCH TOOL: patch -> /usr/bin/patch | |
VERSION INFO: | |
GNU patch 2.7.5 | |
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. | |
Copyright (C) 1988 Larry Wall | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
This is free software: you are free to change and redistribute it. |
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
# Change Java Runtime: | |
sudo update-alternatives --config java | |
# Delete Open-JDK | |
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* | |
# Change fonts - remove hinting: | |
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font | |
# Change RubyMine AntiAliasing first: |