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 | |
# Linked from: https://plus.google.com/+JorgeNer%C3%ADn/posts/3zdnEnXFN7Z | |
# Some oneliners to explore the oom_score* values: | |
# Processes with oom_score_adj != 0: | |
grep . /proc/*/oom_score_adj | grep -v ":0" | grep -v self | perl -ne 'm@/([0-9]+)/oom_score_adj:(-?[0-9]+)@; ($pid,$score)=($1,$2); open FILE,"<","/proc/$pid/cmdline"; $cmd=<FILE>; $cmd=~s/\0.*//; close FILE; print "$score\t$pid\t$cmd\n"; ' | |
# In my system the results sumarized are: | |
# adj 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
Presentation slides and list of commds are available at: | |
https://github.com/gregmalcolm/unix_for_programmers_demo | |
NOTE: I used a Mac with OSX for this demo. Other unixes will differ slightly in behavior! | |
Examples are all written in Python 2.7 | |
=========== | |
Preparation | |
=========== |
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
add_filter('tc_show_single_post_content', 'thumbnails_css_in_pages'); | |
function thumbnails_css_in_pages( $bool ){ | |
global $wp_current_filter, $post; | |
if ( is_page() && isset( $post ) && ! in_array( '__loop', $wp_current_filter) ) | |
return true; | |
return $bool; | |
} | |
/* do not copy the following in your child-theme functions.php*/ | |
/* Following code must be copied in your child-theme style.css without the comments */ |
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
Windows Registry Editor Version 5.00 | |
; 2-tap right click and 3-tap middle click | |
; current user | |
[HKEY_CURRENT_USER\SOFTWARE\Alps\Apoint\Gesture] | |
"2TapSupport"=dword:00000003 | |
"2TapShow"=dword:00000009 | |
"Enable2Tap"=dword:00000001 | |
"2TapFunc"=dword:0000000d |
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
FROM php:7.0-apache | |
RUN apt-get update \ | |
&& apt-get install -y git zlib1g-dev \ | |
&& docker-php-ext-install zip opcache\ | |
&& a2enmod rewrite \ | |
&& sed -i 's!/var/www/html!/var/www!g' /etc/apache2/apache2.conf | |
WORKDIR /var/www |
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
section "InputClass" | |
Identifier "SynPS/2 Synaptics TouchPad" | |
MatchIsTouchpad "on" | |
Driver "libinput" | |
Option "Tapping" "on" | |
EndSection |
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
#!/usr/bin/env bash | |
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11 | |
# | |
# _______________| netspeed : check download speed via command line. | |
# | |
# Usage: netspeed [tokyo, london, usw, use, east, west, URL] | |
# ^default U.S. west coast. | |
# [ -speed_KB/sec ] | |
# ^negation activates the Mbps converter. | |
# |
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 | |
# One line: | |
# curl -L http://git.io/wp.sh | sh | |
# Optionally specify port number: | |
# curl -L http://git.io/wp.sh | PORT=8888 sh | |
# The directory "wordpress" will be created in the current directory. | |
test -e wordpress && echo "wordpress/ already exists" && exit |
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
# useful for running ssl server on localhost | |
# which in turn is useful for working with WebSocket Secure (wss) | |
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/ |
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 | |
# This is a wrapper for adb. If there are multiple devices / emulators, this script will prompt for which device to use | |
# Then it'll pass whatever commands to that specific device or emulator. | |
# Run adb devices once, in event adb hasn't been started yet | |
BLAH=$(adb devices) | |
# Grab the IDs of all the connected devices / emulators | |
IDS=($(adb devices | sed '1,1d' | sed '$d' | cut -f 1 | sort)) |
OlderNewer