https://www.phusionpassenger.com/library/install/apache/install/oss/xenial/
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 | |
# Update the system | |
dnf update -y | |
# Install docker package | |
dnf install docker -y | |
# Start Docker service | |
systemctl start docker |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
int n = 3; | |
int m = 3; | |
int a[3][3] = { 0 }; | |
a[1][1] = 5; | |
int x = 5; |
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
def measure(no_gc = true, &block) | |
if no_gc | |
GC.disable | |
else | |
GC.start | |
end | |
memory_before = `ps -o rss= -p #{Process.pid}`.to_i/1024 | |
gc_stat_before = GC.stat | |
time = Benchmark.realtime do | |
yield |
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 | |
# store start date to a variable | |
imeron=`date` | |
echo "Import started: OK" | |
dumpfile="/home/bob/bobiras.sql" | |
ddl="set names utf8; " | |
ddl="$ddl set global net_buffer_length=1000000;" |
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
sizes = [10, 50, 100, 1000] | |
sizes.each do |size| | |
array = size.times.map { |i| rand(size) } | |
threshold = size / 2 | |
Benchmark.bmbm(2) do |x| | |
x.report("select #{size}") do | |
array.select { |item| item > threshold } | |
.each { |item| item * item } |
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
filename = 'flowdata_201803052230.sql' | |
INSERT_MATCHER = 'INSERT INTO' | |
file = 1 | |
counter = 1 | |
File.open(filename, 'r').each do |line| | |
next unless line.include? INSERT_MATCHER | |
File.open(file.to_s + '.sql', 'a+') { |file| file.write("\n" + line) } |
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 A | |
protected | |
def protected_a | |
puts "Protected A" | |
end | |
private | |
def private_a | |
puts "Private A" | |
end |
NewerOlder