Install Hyper-V guest services on Ubuntu and Debian VM's

Ubuntu:

Add to /etc/initramfs-tools/modules

hv_utils
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc

Install

apt install linux-virtual linux-cloud-tools-virtual linux-tools-virtual

Update initramfs:

update-initramfs -u

Reboot. Done.

Debian:

apt install hyperv-daemons
Share:

Run Gitlab pipeline job on multiple runners - template

.deploy: 		# template to run
  tags:
    - $HOST_TAG
    - prod
  script:
    - ...
deploy-nodes:
  stage: deploy
  only: 		# execute only on main branch
    - main
  needs: 		# run only if test-nodes passed
    - test-nodes
  extends: .deploy 	# exetue script from
  parallel: 		# run jobs in parrallel
    matrix: 		# specify tags to run on
      - HOST_TAG:
        - hostname01
        - hostname02
        - ...

Share:

MySQL databases and tables size.

Databases size:

SELECT table_schema AS "Database",  ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)"  FROM information_schema.TABLES  GROUP BY table_schema;

Tables size in database:

SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024 / 1024), 2) AS "Size (GB)" FROM information_schema.TABLES WHERE table_schema = "[database_name]" ORDER BY (data_length + index_length) DESC limit 5;

Share:

It's always DNS

When your server responds too long for some packets and application gets timeout, ask your DNS server if it has reverse proxy zone for that address. If not, for troubleshooting you can try add line in hosts file and see if that resolve issue. 

Share:

'Too many open files' in log file - resolution

Too many open files and service crashes. Edit serivce:

systemctl edit [service_name]

Add in file in correct section:

[Service]
LimitNOFILE=65536
LimitSTACK=infinity
LimitNPROC=16384
TasksMax=8192

Reload systemctl:

systemctl daemon-reload

Restart service:

systemctl restart [service_name]
Share:

Add disk to lvm

List of commands to add new disk to lvm and add storage to /.

Format drive fdisk /dev/sdb:

[root@centos7 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x4507ff75.
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-16777215, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-16777215, default 16777215): 
Using default value 16777215
Partition 1 of type Linux and of size 8 GiB is set
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Create pv on sdb1

pvcreate /dev/sdb1

Add to vg

vgextend name_of_vg /dev/sdb1

lvresize -l +100%free path_of_lv

find out file system on partition 

grep root /etc/mtab

case:

    xfs: 

xfs_growfs /dev/mapper/...

    ext4:

 resize2fs /dev/mapper/...

done

Share:

Debrick TP-Link Archer C7 v5

 I had OpenWrt installed on my Archer C7 v5 for a while. I wanted to return to TP-Link firmware. I tried to get it done via installed Luci web interface (don't do this!). Router didn't recover.

After restart I had only still power LED. I found about tftp recovery mode but it didn't work for me. I connected via UART, but one line on the PCB is not connected to the PIN. I try to solder it, but my skills where to low. I found solutions as you can see on the photos below. I put a needle trough a cable and hold it to the line on PCB while turning on router in recovery mode. Than I was able to send commands to the router. 

It was some time ago, so I don't remember all the commands.


More on this topic: 

https://openwrt.org/toh/tp-link/archer-c5-c7-wdr7500#serial

https://www.reddit.com/r/openwrt/comments/en8845/archer_c7_v5_debricking/

https://forum.openwrt.org/t/archer-c7-v5-revert-to-stock-firmware/44864/6

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=5bdd238b634a34b038fbea9046893de29a77c000

https://forum.openwrt.org/t/solved-archer-c7-ru-v5-tftp-install-does-not-works/28946








ath> tftpboot Trying eth0 dup 1 speed 1000 *** Warning: no boot file name; using '0200A8C0.img' Using eth0 device TFTP from server 192.168.0.10; our IP address is 192.168.0.2 Filename '0200A8C0.img'. Load address: 0x81000000 Loading: ################################################################# ################################################################# removed many similar lines ################################################################# ####################################### done Bytes transferred = 15504354 (ec93e2 hex) ath> erase 0x9f020000 +ec93e2 Erasing flash... First 0x2 last 0xee sector size 0x10000 238 Erased 237 sectors ath> cp.b 0x81000000 0x9f020000 0xec93e2 Copy to Flash... write addr: 9f020000 done ath> reset U-Boot 1.1.4 (Mar 8 2018 - 16:34:18) ap152 - Dragonfly 1.0 DRAM: 128 MB Top of RAM usable for U-Boot at: 88000000 Reserving 413k for U-Boot at: 87f98000 Reserving 16448k for malloc() at: 86f88000 Reserving 44 Bytes for Board Info at: 86f87fd4 Reserving 36 Bytes for Global Data at: 86f87fb0 Reserving 128k for boot params() at: 86f67fb0 Stack Pointer at: 86f67f98 Now running in RAM - U-Boot at: 87f98000 Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18 flash size 16MB, sector count = 256 Flash: 16 MB Using default environment In: serial Out: serial Err: serial Net: ath_gmac_enet_initialize... Fetching MAC Address from 0x87fbafdc ath_gmac_enet_initialize: reset mask:c02200 athr_mgmt_init ::done Dragonfly ----> S17 PHY * athrs17_reg_init: complete SGMII in forced mode athr_gmac_sgmii_setup SGMII done : cfg1 0x80000000 cfg2 0x7114 eth0: 00:00:29:ad:00:00 eth0 up eth0 Setting 0x181162c0 to 0x41822100 [NM_Error](nm_api_checkInteger) 00384: extra-para:a6 3b [NM_Error](nm_api_checkInteger) 00389: factory boot check integer flag is not 1. Hit any key to stop autoboot: 0 Trying eth0 eth0 link down FAIL Trying eth0 dup 1 speed 1000 HTTP server is starting at IP: 192.168.0.1 HTTP server is ready!

After that I browse for TP-Link stock firmware, flashed it through web interface (192.168.0.1) and it came back. Succeed!

Share: