Skip to content

Commit

Permalink
many changes
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsiryk committed Jun 30, 2017
1 parent ac0b28f commit 63d8cf6
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 23 deletions.
5 changes: 5 additions & 0 deletions Docker/docker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ To list image digest values, use the --digests flag::
docker push ouruser/sinatra


Docker installation
-------------------

https://docs.docker.com/engine/installation/linux/


Docker monitoring
-----------------
Expand Down
2 changes: 2 additions & 0 deletions Docker/docker_compose.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Docker-compose

Installation::

# https://docs.docker.com/compose/install/

# Docker
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
Expand Down
43 changes: 36 additions & 7 deletions MacOS/mac_programming.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,44 @@ https://en.wikibooks.org/wiki/AppleScript_Programming/System_Events

Loop (repeat) - http://alvinalexander.com/apple/applescript-for-loop-while-loop-examples


Check if static text start with::

if value of static text 1 of group 2 of group 1 of UI element 1 of scroll area 1 does not start with "Enter the verification code" then
error "Expected label does not exist."
end if


Check multiple elements exists::

if (static text "bla bla" exists) and (static text "yeah" exists) and (text field 1 exists) then
log "true"
else
log "false"
end if


Check if button not exists::

if not exists (button "Verify") then
error "Verify buttonl does not exist."
end if


Get all UI elements::

set t1 to get every UI element
log "---\nGet every UI element\n---"
repeat with i in t1
log i
log "\n"
end repeat
log "---\nEnd\n---"
# my showElements(element, "test")
# showElements(element, "test")
on showElements(element, id)
log "-" & id & "-"
tell application "System Events"
set elements to get every UI element of element
repeat with el in elements
log el
end repeat
end tell
log "-" & id & "-"
end showElements"


Show all processes of application::
Expand Down
13 changes: 13 additions & 0 deletions MacOS/virtual_mac_machine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ Mac OS VM

Important repo https://github.com/kholia/OSX-KVM

Clean up unused VM disk space
-----------------------------

::

# on guest with Mac OS
cat /dev/zero > zfile; rm zfile

# shutdown VM

# on host
vmware-vdiskmanager -k </path/to/disk.vmdk>


Run Sierra on qemu-kvm
----------------------
Expand Down
37 changes: 24 additions & 13 deletions SWAP.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,39 @@ SWAP in file



Automated swapfile create
^^^^^^^^^^^^^^^^^^^^^^^^^
Automated swapfile creation
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Run as root::
::

#!/bin/sh
#!/bin/bash

# Create SWAP file at root with size 4GB
dd if=/dev/zero of=/swapfile bs=1M count=4096
chmod 600 /swapfile
mkswap /swapfile
set -e

# SWAP file size in MB
SWAP_SIZE="1024"

# SWAP usage tunning
VM_SWAPPINESS="30"

SWAP_PATH="/swapfile"


# Create SWAP file at root
sudo dd if=/dev/zero of=$SWAP_PATH bs=1M count=$SWAP_SIZE
sudo chmod 600 $SWAP_PATH
sudo mkswap $SWAP_PATH

# Disable all SWAP
swapoff -a
sudo swapoff -a

# Connect new SWAP file
swapon /swapfile
sudo swapon $SWAP_PATH

# Add new SWAP to fstab (auto mount when system start)
sudo echo "/swapfile swap swap defaults 0 0" | sudo tee -a /etc/fstab
sudo echo "$SWAP_PATH swap swap defaults 0 0" | sudo tee -a /etc/fstab

# Tweak system swap usage value
sudo sysctl -w vm.swappiness=30
sudo sysctl -w vm.swappiness=$VM_SWAPPINESS


7 changes: 7 additions & 0 deletions esxi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
===========
VMWARE ESXI
===========

Storages path **/vmfs/volumes**


2 changes: 1 addition & 1 deletion linux_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Empty pagecache, dentries and inodes::
# run as root

# pagecache
free -h && echo && sync && echo > /proc/sys/vm/drop_caches && free -h
free -h && echo && sync && echo 1 > /proc/sys/vm/drop_caches && free -h

# (not recomended) pagecache, dentries and inodes
free -h && echo && sync && echo 3 > /proc/sys/vm/drop_caches && free -h
Expand Down
5 changes: 5 additions & 0 deletions ovh.com.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
=======
OVH.COM
=======

Kernel images by OVH **ftp://ftp.ovh.net/made-in-ovh/bzImage/**
24 changes: 24 additions & 0 deletions rsyslog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
rsyslog
=======

Modern syslog configuration - https://selivan.github.io/2017/02/07/rsyslog-log-forward-save-filename-handle-multi-line-failover.html


Rules path::

/etc/rsyslog.d/*.conf # num-<name>.conf (num < 50-default.conf)
Expand All @@ -26,6 +29,27 @@ ON receive logs from UDP ``/etc/rsyslog.conf``::
sudo service rsyslog restart


Configuration
-------------

File create mode (rights)::

$umask 0000
*.* /var/log/file-with-0644-default

$FileCreateMode 0600
*.* /var/log/file-with-0600

$FileCreateMode 0644
*.* /var/log/file-with-0644


Remote_syslog
-------------

Read txt files and send logs to syslog remote server - https://github.com/papertrail/remote_syslog2


Rotate received logs to files
-----------------------------

Expand Down
2 changes: 1 addition & 1 deletion ssl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Show info::
openssl x509 -noout -issuer -enddate -in root.pem

# show cert expire time
openssl x509 -in /etc/letsencrypt/live/elk.swipe-services.com/fullchain.pem -text -noout | grep -A3 Validity
openssl x509 -in /etc/letsencrypt/live/example.com/fullchain.pem -text -noout | grep -A3 Validity


Validate the certificate even though the protocol used to communicate with server is not based on HTTP. For example::
Expand Down
2 changes: 1 addition & 1 deletion vmware.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ https://pubs.vmware.com/workstation-12/index.jsp#com.vmware.ws.using.doc/GUID-1F

::

sh VMware-Workstation-xxxx-xxxxxxx.architecture.bundle --console --custom
sh VMware-Workstation-xxxx-xxxxxxx.architecture.bundle --console --custom --eulas-agreed

# deafults:
# /var/lib/vmware/Shared VMs
Expand Down

0 comments on commit 63d8cf6

Please sign in to comment.