kubectl run nginx --image=nginx
kubectl run nginx --image=nginx --dry-run=client -o yaml
def user_params(user) | |
{ | |
id: user.cio_id, | |
first_name: user.first_name, | |
last_name: user.last_name, | |
email: user.email, | |
} | |
end | |
cio_client = Customerio::Client.new(ENV['CUSTOMER_IO_SITE_ID'], ENV['CUSTOMER_IO_API_KEY']) |
mutex = Mutex.new | |
flags = [false, false, false, false, false, false, false, false, false, false] | |
threads = 50.times.map do | |
Thread.new do | |
100000.times do | |
puts flags.to_s | |
mutex.synchronize do | |
flags.map! { |f| !f } | |
end |
def match_urls_in_cities(file_names) | |
cities_count = {} | |
file_names.each do |file_name| | |
File.open(file_name, "r") do |f| | |
f.each_line do |line| | |
city_name = line.match(/(.*)\t/)[0].gsub("\t", "") | |
cities_count[city_name] ||= 0 | |
cities_count[city_name] += 1 if is_url_present?(line) | |
end | |
end |
func Backspace() | |
if col('.') == 1 | |
if line('.') != 1 | |
return "\<ESC>kA\<Del>" | |
else | |
return "" | |
endif | |
else | |
return "\<Left>\<Del>" | |
endif |
["*", "%", "`", "-" ,"\\", "/", "[", "]", "{", "}", "&", "#", "$", "@", "!", "^", "(", ")", "'", '"', ',' ] |
load 'scratch.rb' | |
include Scratch | |
default_command_set = Pry::CommandSet.new do | |
command "scratch!", "reload scratch" do |str| | |
load 'scratch.rb' | |
end | |
end | |
Pry.config.commands.import default_command_set |
# if(statement) | |
https://i.stack.imgur.com/MKgie.png | |
#if statement1 == statement2 | |
https://i.stack.imgur.com/5bdbd.png | |
#if st1 === st2 | |
https://i.stack.imgur.com/mmvud.png |
# network manager applet | |
nm-applet |
# add new user to apache authorization | |
# /etc/apache2/.htpasswd - authorization file, can be rewtitted by website | |
# apache configuration | |
sudo htpasswd /etc/apache2/.htpasswd another_user |