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
vm.swappiness=90 | |
vm.dirty_ratio=50 | |
vm.dirty_background_ratio=30 | |
vm.dirty_writeback_centisecs=60000 | |
vm.vfs_cache_pressure=150 | |
vm.laptop_mode=1 | |
vm.page-cluster=1 | |
vm.min_free_kbytes=2048 | |
vm.memory_failure_recovery=1 | |
vm.panic_on_oom=1 |
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
This sysctl.conf is used on a CentOS 6.2 system doing heavy tcp comms using ActiveMQ. | |
fs.file-max = 999999 | |
net.core.netdev_max_backlog = 10240 | |
net.core.somaxconn = 10240 | |
net.ipv4.conf.all.accept_redirects = 0 | |
net.ipv4.conf.all.accept_source_route = 0 | |
net.ipv4.conf.all.rp_filter = 1 |
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
/etc/sysctl.conf | |
kernel.ctrl-alt-del=1 | |
kernel.sysrq=0 | |
kernel.panic=10 | |
kernel.core_pattern=/dev/null | |
kernel.shmmax=262324224 | |
fs.file-max=128000 | |
net.core.wmem_default=200100 | |
net.core.rmem_default=200100 | |
net.core.wmem_max=3202200 |
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
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
# | |
# Use '/sbin/sysctl -a' to list all possible parameters. | |
# Controls IPv4 Security | |
net.ipv4.ip_forward=0 | |
net.ipv4.conf.all.send_redirects=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
ARCH=$(uname -m) | |
which bc | |
if [ $? -ne 0 ]; then | |
echo "This script require GNU bc, cf. http://www.gnu.org/software/bc/" | |
echo "On Linux Debian/Ubuntu you can install it by doing : apt-get install bc" | |
fi | |
echo "Update sysctl for $host" |
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
net.ipv4.ip_forward = 1 | |
net.ipv4.conf.all.send_redirects = 0 | |
net.ipv4.conf.default.send_redirects = 0 | |
net.ipv4.conf.eth0.send_redirects = 0 | |
net.ipv4.conf.lo.send_redirects = 0 | |
net.ipv4.conf.all.accept_redirects = 0 | |
net.ipv4.conf.default.accept_redirects = 0 | |
net.ipv4.conf.eth0.accept_redirects = 0 | |
net.ipv4.conf.lo.accept_redirects = 0 | |
net.ipv4.tcp_fastopen = 0x403 |
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
//: Playground - noun: a place where code can play | |
import UIKit | |
//Most precise time keeper | |
// for more information on the benchmarks go to www.kandelvijaya.com | |
func timeBlockWithMach(_ block: () -> Void) -> TimeInterval { | |
var info = mach_timebase_info() | |
guard mach_timebase_info(&info) == KERN_SUCCESS else { return -1 } |
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
// It's tested on ios 8.2 .. | |
// Apple document about virtual memory: | |
// Both OS X and iOS include a fully-integrated virtual memory system that you cannot turn off; it is always on. | |
// https://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html | |
// Discussing mmap on ios: | |
// http://stackoverflow.com/questions/13425558/why-does-mmap-fail-on-ios | |
// http://stackoverflow.com/questions/9184773/is-there-a-practical-limit-on-the-number-of-memory-mapped-files-in-ios | |
#include <sys/mman.h> |
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
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:roundIcon="@mipmap/ic_launcher_round" | |
android:supportsRtl="true" | |
android:theme="@style/AppTheme" | |
android:networkSecurityConfig="@xml/network_security_config"> |
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
% it creates a simple gray image (4x4) | |
I = [255, 255, 30, 100 | |
255, 50, 90, 20 | |
70, 70, 20, 10 | |
100, 20, 10, 0]; | |
% it converts it to grayscale | |
I = mat2gray(I); | |
% shows it | |
imshow(I); |
OlderNewer