ownCloud occ

ownCloud occ

Go to the ownCloud directory /var/www/owncloud and run occ

sudo -u www-data php occ 
ownCloud version 8.2.0

Usage:
 [options] command [arguments]

Options:
 --help (-h)           Display this help message
 --quiet (-q)          Do not output any message
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version
 --ansi                Force ANSI output
 --no-ansi             Disable ANSI output
 --no-interaction (-n) Do not ask any interactive question

Available commands:
 check                                check dependencies of the server environment
 help                                 Displays help for a command
 list                                 Lists commands
 status                               show some status information
 upgrade                              run upgrade routines after installation of a new release. The release has to be installed before.
app
 app:check-code                       check code to be compliant
 app:disable                          disable an app
 app:enable                           enable an app
 app:list                             List all available apps
background
 background:ajax                      Use ajax to run background jobs
 background:cron                      Use cron to run background jobs
 background:webcron                   Use webcron to run background jobs
config
 config:app:delete                    Delete an app config value
 config:app:get                       Get an app config value
 config:app:set                       Set an app config value
 config:import                        Import a list of configs
 config:list                          List all configs
 config:system:delete                 Delete a system config value
 config:system:get                    Get a system config value
 config:system:set                    Set a system config value
db
 db:convert-type                      Convert the ownCloud database to the newly configured one
 db:generate-change-script            generates the change script from the current connected db to db_structure.xml
encryption
 encryption:change-key-storage-root   Change key storage root
 encryption:decrypt-all               Disable server-side encryption and decrypt all files
 encryption:disable                   Disable encryption
 encryption:enable                    Enable encryption
 encryption:encrypt-all               Encrypt all files for all users
 encryption:list-modules              List all available encryption modules
 encryption:set-default-module        Set the encryption default module
 encryption:show-key-storage-root     Show current key storage root
 encryption:status                    Lists the current status of encryption
files
 files:cleanup                        cleanup filecache
 files:scan                           rescan filesystem
l10n
 l10n:createjs                        Create javascript translation files for a given app
log
 log:manage                           manage logging configuration
 log:owncloud                         manipulate ownCloud logging backend
maintenance
 maintenance:mimetype:update-db       Update database mimetypes and update filecache
 maintenance:mimetype:update-js       Update mimetypelist.js
 maintenance:mode                     set maintenance mode
 maintenance:repair                   repair this installation
 maintenance:singleuser               set single user mode
trashbin
 trashbin:cleanup                     Remove deleted files
user
 user:add                             adds a user
 user:delete                          deletes the specified user
 user:lastseen                        shows when the user was logged it last time
 user:report                          shows how many users have access
 user:resetpassword                   Resets the password of the named user
versions
 versions:cleanup                     Delete versions

Enable ownCloud maintenance mode

sudo -u www-data php occ maintenance:mode --on

Disable ownCloud maintenance mode

sudo -u www-data php occ maintenance:mode --off

Upgrade ownCloud

sudo -u www-data php occ upgrade
ownCloud or one of the apps require upgrade - only a limited number of commands are available
Set log level to debug - current level: 'Warning'
Checked database schema update
Checked database schema update for apps
Updated database
Disabled 3rd-party app: documents
Disabled 3rd-party app: search_lucene
Updating  ...
Updated  to 2.0
Updating  ...
Updated  to 14.2.0
Updating  ...
Updated  to 1.2.0
Updating  ...
Updated  to 2.1.3
Updating  ...
Updated  to 0.7.0
Updating  ...
Updated  to 0.7.0
Updating  ...
Updated  to 1.1.0
Updating  ...
Updated  to 0.3.0
Update successful
Maintenance mode is kept active
Reset log level to 'Warning'

Status from ownCloud

sudo -u www-data php occ status
  - installed: true
  - version: 8.2.0.12
  - versionstring: 8.2.0
  - edition: 

Too many authentication failures for root

Too many authentication failures for root

If you get the following error, the most reason is, that you have to many ssh keys.

“Received disconnect from 172.23.23.23: 2: Too many authentication failures for root”

This is easy to fix for password authentication

ssh -o PubkeyAuthentication=no safematix@172.23.23.23

This is easy to fix for a other key

ssh -i .ssh/keyfile safematix@172.23.23.23

inxi – a full featured system information script

inxi – a full featured system information script

inxi
inxi

inxi -F -xxx

System:    Host: chz01vh01 Kernel: 3.19.0-30-generic x86_64 (64 bit, gcc: 4.8.2) Console: tty 2 Distro: Ubuntu 14.04 trusty
Machine:   Mobo: ASUSTeK model: SABERTOOTH 990FX version: Rev 1.xx serial: ***********
           Bios: American Megatrends version: 1604 date: 10/16/2012
CPU:       Octa core AMD FX-8150 Eight-Core (-MCP-) cache: 16384 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 57788.9 
           Clock Speeds: 1: 3611.805 MHz 2: 3611.805 MHz 3: 3611.805 MHz 4: 3611.805 MHz 5: 3611.805 MHz 6: 3611.805 MHz 7: 3611.805 MHz 8: 3611.805 MHz
Graphics:  Card: Failed to Detect Video Card! 
           X-Vendor: N/A driver: N/A tty size: 117x31 Advanced Data: N/A for root out of X
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 
           driver: r8169 ver: 2.3LK-NAPI port: 9000 bus-ID: 09:00.0 chip-ID: 10ec:8168
           IF: eth0 state: down mac: ************
           Card-2: Intel 82572EI Gigabit Ethernet Controller (Copper) 
           driver: e1000e ver: 2.3.2-k port: c000 bus-ID: 05:00.0 chip-ID: 8086:107d
           IF: p11p1 state: up speed: 1000 Mbps duplex: full mac: ************
           Card-3: Intel 82572EI Gigabit Ethernet Controller (Copper) 
           driver: e1000e ver: 2.3.2-k port: a000 bus-ID: 08:00.0 chip-ID: 8086:10b9
           IF: eth2 state: down mac: ************
           Card-4: Intel 82574L Gigabit Network Connection 
           driver: e1000e ver: 2.3.2-k port: b000 bus-ID: 06:00.0 chip-ID: 8086:10d3
           IF: p13p1 state: up speed: 1000 Mbps duplex: full mac: ************
Drives:    HDD Total Size: 34006.7GB (22.5% used)
           1: id: /dev/sda model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 24C 
           2: id: /dev/sdb model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 23C 
           3: id: /dev/sdc model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 23C 
           4: id: /dev/sdd model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 24C 
           5: id: /dev/sde model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 24C 
           6: id: /dev/sdf model: WDC_WD30EFRX size: 3000.6GB serial: WD-************ temp: 24C 
           7: id: /dev/sdg model: WDC_WD40EFRX size: 4000.8GB serial: WD-************ temp: 28C 
           8: id: /dev/sdh model: WDC_WD40EFRX size: 4000.8GB serial: WD-************ temp: 29C 
           9: id: /dev/sdi model: WDC_WD40EFRX size: 4000.8GB serial: WD-************ temp: 28C 
           10: id: /dev/sdj model: WDC_WD40EFRX size: 4000.8GB serial: WD-************ temp: 29C 
Partition: ID: / size: 3.8G used: 516M (14%) fs: xfs ID: /usr size: 3.8G used: 783M (21%) fs: xfs 
           ID: /var size: 14G used: 3.9G (29%) fs: xfs ID: /tmp size: 4.6G used: 9.4M (1%) fs: ext2 
           ID: /boot size: 923M used: 44M (5%) fs: ext3 ID: swap-1 size: 8.00GB used: 0.00GB (0%) fs: swap 
           ID: swap-2 size: 8.00GB used: 0.00GB (0%) fs: swap ID: swap-3 size: 8.00GB used: 0.00GB (0%) fs: swap 
           ID: swap-4 size: 8.00GB used: 0.00GB (0%) fs: swap 
RAID:      System: supported: raid1 raid6 raid5 raid4 linear multipath raid0 raid10 
           Device-1: /dev/md1 - active components: online: sdj4[1] sdi4[3] sdg4[5] sdh4[4]
           Info: raid: 1 report: 4/4 UUUU blocks: 927603520 chunk size: N/A super blocks: 1.2
           Device-2: /dev/md0 - active components: online: sdi2[0] sdj2[1] sdh2[4] sdg2[5]
           Info: raid: 1 report: 4/4 UUUU blocks: 976320 chunk size: N/A super blocks: 1.2
           Device-3: /dev/md2 - active components: online: sdg5[10] sdj5[9] sdi5[8] sdh5[11] sdb1[0] sdc1[2] sde1[4] sdf1[5] sdd1[3] sda1[1]
           Info: raid: 6 report: 10/10 UUUUUUUUUU blocks: 23441068032 chunk size: 512k super blocks: 1.2 algorithm: 2
           Unused Devices: none
Sensors:   System Temperatures: cpu: 27.9C mobo: N/A 
           Fan Speeds (in rpm): cpu: N/A 
Info:      Processes: 296 Uptime: 2 days Memory: 5484.8/11897.6MB Runlevel: 2 Gcc sys: N/A 
           Client: Shell (zsh 5.0.2 running in tty 2) inxi: 1.9.17

HP iLO Reset via SSH

HP iLO Reset via SSH

iLO
iLO

Login with ssh to iLO IP.

cd /map1
reset

ssh adminuser@172.23.23.23
The authenticity of host '172.23.23.23 (172.23.23.23)' can't be established.
RSA key fingerprint is 8d:cb:23:ab:7a:ea:97:d2:23:6e:1a:1a:08:77:18:39.
+---[RSA 1024]----+
|                 |
|   .             |
|  E              |
|   +     o       |
|. o .   S .      |
| o o   o +       |
|  . ....+        |
|    .o*oo        |
|   .=*o*.        |
+-----------------+
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.23.23.23' (RSA) to the list of known hosts.
adminuser@172.23.23.23's password: 
User:tech logged-in to ILOCZ2323E3HD.(172.23.23.23 / FE80::2358:D0FF:FE3C:23EC)
iLO 4 Advanced 2.02 at  Sep 05 2014
Server Name: servername
Server Power: Off

Based on customer feedback, we will be enhancing the SSH command line
interface in a future release of the iLO 4 firmware.  Our future CLI will
focus on increased usability and improved functionality.  This message is
to provide advance notice of the coming change.  Please see the iLO 4 
Release Notes on www.hp.com/go/iLO for additional information.

hpiLO-> cd /map1

status=0
status_tag=COMMAND COMPLETED
Thu Oct 15 06:11:49 2015

/map1

hpiLO-> reset

status=0
status_tag=COMMAND COMPLETED
Thu Oct 15 06:11:53 2015

Resetting iLO.


CLI session stopped
Received disconnect from 172.23.23.23: 11:  Client Disconnect

Raspberry Pi – reading system values

Raspberry Pi – reading system values

Raspberry Pi
Raspberry Pi

To read the system values and status, you can use the tool vcgencmd.

To list the version

vcgencmd version

Oct 11 2015 16:16:21 
Copyright (c) 2012 Broadcom
version cdea693c2a4280e4855643dc7840392d915f19b8 (clean) (release)

To list all parameters

vcgencmd commands

commands="vcos, ap_output_control, ap_output_post_processing, vchi_test_init, vchi_test_exit, pm_set_policy, pm_get_status, pm_show_stats, pm_start_logging, pm_stop_logging, version, commands, set_vll_dir, led_control, set_backlight, set_logging, get_lcd_info, set_bus_arbiter_mode, cache_flush, otp_dump, test_result, codec_enabled, get_camera, get_mem, measure_clock, measure_volts, scaling_kernel, scaling_sharpness, get_hvs_asserts, measure_temp, get_config, hdmi_ntsc_freqs, hdmi_adjust_clock, hdmi_status_show, hvs_update_fields, pwm_speedup, force_audio, hdmi_stream_channels, hdmi_channel_map, display_power, read_ring_osc, memtest, dispmanx_list, get_rsts, schmoo, render_bar, disk_notify, inuse_notify, sus_suspend, sus_status, sus_is_enabled, sus_stop_test_thread, egl_platform_switch, mem_validate, mem_oom, mem_reloc_stats, file, vctest_memmap, vctest_start, vctest_stop, vctest_set, vctest_get"

To get the running config

vcgencmd get_config int

arm_freq=900
config_hdmi_boost=5
disable_commandline_tags=2
disable_l2cache=1
emmc_pll_core=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
hdmi_force_cec_address=65535
over_voltage_avs=0x1b774
pause_burst_frames=1
program_serial_random=1
sdram_freq=450
temp_limit=85

To get the memory for the system

vcgencmd get_mem arm

arm=944M

To get the memory for the gpu

vcgencmd get_mem gpu

gpu=64M

List processor temperature

vcgencmd measure_temp

temp=34.7'C

To get the volt

vcgencmd measure_volts

volt=1.2000V

To get the cpu clock in Hz

vcgencmd measure_clock arm

frequency(45)=600000000

How to grow RAID+LUKS+lvm+xfs

How to grow RAID+LUKS+lvm+xfs
clone partition table, add disk to mdraid, resize mdraid, cryptsetup and Volume Group

luks
luks

If you like to add a new disk to mdadm raid, you should clone the partition layout.

sgdisk -R /dev/sdY /dev/sdX
sgdisk -G /dev/sdY

The first command copies the partition table of sdX to sdY (be careful not to mix these up). The second command randomizes the GUID on the disk and all the partitions. This is only necessary if the disks are to be used in the same machine, otherwise it’s unnecessary.

Add new disks to raid:

mdadm --add /dev/sdb1 

Grow the raid:

mdadm --grow --raid-devices=9 --backup-file=/tmp/grow_md2.bak /dev/md2

Information of reshape:

cat /proc/mdstat                                                                                                                                                                                                                                                                                     
Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10] 
md1 : active raid1 sdg4[5] sdh4[4] sdi4[3] sdj4[1]
      927603520 blocks super 1.2 [4/3] [UUU_]
      	resync=DELAYED
      
md0 : active raid1 sdg2[5] sdi2[0] sdh2[4] sdj2[1]
      976320 blocks super 1.2 [4/3] [UUU_]
      	resync=DELAYED
      
md2 : active raid6 sdg5[10](S) sdi5[8] sdj5[9] sdh5[11] sdd1[3] sdb1[0] sdf1[5] sdc1[2] sde1[4] sda1[1]
      20510934528 blocks super 1.2 level 6, 512k chunk, algorithm 2 [10/9] [UUUUUUUU_U]
      [====>................]  reshape = 20.2% (592765952/2930133504) finish=3123.9min speed=12469K/sec
      
unused devices: 

Speed up the rebuild or reshape:

If you only have 1000, you should set to a higher value.

cat /proc/sys/dev/raid/speed_limit_min                                                                                                                                                                                                                                                           
1000

Set the speed_limit_min to 50000.

echo 50000 > /proc/sys/dev/raid/speed_limit_min

Resize the partition with parted:

parted /dev/md2 resizepart

Resize the LUKS partition:

cryptsetup resize cryptvg

Show the status from the LUKS partition:

cryptsetup status cryptvg

Show the status from the physical volume:

pvdisplay

Resize the physical volume

pvresize /dev/mapper/cryptvg 

Show the status from the volume group:

vgs

Resize the xfs filesystem:

xfs_growfs /dev/cryptvg/test

Tricks

Detail information of the mdadm raid.

mdadm --detail /dev/md1

If you have a problem with the raid:

mdadm --stop /dev/md2
mdadm --assemble /dev/md2  /dev/sdh5 /dev/sdb1 /dev/sde1 /dev/sdc1 /dev/sdf1 /dev/sdd1 /dev/sda1 /dev/sdi5 /dev/sdg5
mdadm --run /dev/md2

If it now work, force:

mdadm --assemble --run --force  /dev/md2 /dev/sdb1 /dev/sde1 /dev/sdc1 /dev/sdf1 /dev/sdd1 /dev/sda1 /dev/sdi5 /dev/sdg5 /dev/sdh5

Disk status

mdadm --examine /dev/sd*