Short version: See docs.microsoft.com link below.
sudo apt-get update
sudo apt-get install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import getpass | |
import logging | |
import logging.config | |
import os | |
import socket | |
try: |
# Ansible 'lineinfile' like function in Shell Script. | |
# Works on both Bash and Zsh. | |
function lineinfile(){ | |
if [[ $# != 3 ]];then | |
local THIS_FUNC_NAME="${funcstack[1]-}${FUNCNAME[0]-}" | |
echo "$THIS_FUNC_NAME - 3 arguments are expected. given $#. args=[$@]" >&2 | |
echo "usage: $THIS_FUNC_NAME PATTERN LINE FILE" >&2 | |
return 1 | |
fi |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3YsqKzVhYGRzBNbP2dOeEmdr/b8OmC/XgSFA8wjhyyY+K5dWPELRJQT5mZs11V/ntrjUB/O18tjb9rAqQsE4mOUUu8rGZf4lrXULxu2LkmQc4gXKX6LssanUugUk4XbatX8pFKsq5P51nHoyfJ0p0uFLvEcWl32r2HPD/ThfR0jaiNDtp4cUu1YD0aJjQuMhsnZLyl8GFc9qFgKTit0OdcGauYbDEUR+2w4MuUrwTBiVhKyGyhj86KVqNbNtopWDWfp4S6sBQtbog7aQ0dhErNDK79qaJrlywRsdFdLqp76a4GGfGdSdBhQZWCqjpfKrPchhjfZCo75efF/LXdm0V /home/alexkuklin/.ssh/id_rsa |
version: '2' | |
networks: | |
consul_net: | |
driver: bridge | |
ipam: | |
driver: default | |
config: | |
- | |
subnet: 172.16.238.0/24 |
#!/usr/bin/perl | |
package World::Schema; | |
use base qw/DBIx::Class::Schema::Loader/; | |
$ENV{SCHEMA_LOADER_BACKCOMPAT} = 1; | |
my $schema = World::Schema->connect("DBI:mysql:database=world", "world", "world1", | |
{PrintError => 1, RaiseError => 1, mysql_enable_utf8 => 1}); | |
package main; | |
use DBIx::Connector; | |
use DBIx::Struct; |
-- Query the database to calculate a recommended innodb_buffer_pool_size | |
-- and get the currently configured value | |
-- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB. | |
SELECT | |
TABLE_SCHEMA, | |
CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) | |
Recommended_InnoDB_Buffer_Pool_Size, | |
( | |
SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1)) |
From: http://stackoverflow.com/questions/1676632/whats-a-quick-way-to-comment-uncomment-lines-in-vim
For those tasks I use most of the time block selection.
Put your cursor on the first #
character, press Ctrl``V
(or Ctrl``Q
for gVim), and go down until the last commented line and press x
, that will delete all the #
characters vertically.
For commenting a block of text is almost the same: First, go to the first line you want to comment, press Ctrl``V
, and select until the last line. Second, press Shift``I``#``Esc
(then give it a second), and it will insert a #
character on all selected lines. For the stripped-down version of vim shipped with debian/ubuntu by default, type : s/^/#
in the second step instead.
#!/usr/bin/sh | |
# Flush Linux pagecache, dentrie & inode (cache) | |
# Reswaping 0B | |
MIN_MEMORY=78643200 # Reswap only if there is free RAM (75MB) | |
#PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin | |
#PATH=/bin:/sbin:$PATH | |
# Flush pagecache + reswaping 0B: |
#!/usr/bin/perl | |
use Benchmark qw(:all); | |
use Storable; | |
use Clone; | |
use CBOR::XS; | |
use Data::MessagePack; | |
use Panda::Lib; | |
use Sereal; | |
use Sereal::Dclone; |