Fedora CPU frequency scaling

Published on Author admin

At first install kernel-tools (provides cpupower tool): dnf install kernel-tools Get current CPU governor: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor List available CPU governors: cpupower frequency-info --governors Get current CPU frequency: cpupower frequency-info or lscpu | grep "CPU MHz" Set performance governor: cpupower frequency-set --governor performance Set powersave governor: cpupower frequency-set --governor powersave Kernel documentation: CPUFreq Governors

Using AWS EC2 CLI - part 2

Published on Author admin

Using AWS EC2 CLI - part 2 Script for checking VMs status: https://github.com/openterprise/scripts/blob/master/aws-status.sh Example user data file script: https://github.com/openterprise/scripts/blob/master/aws-user-data.sh #create VM centos aws ec2 run-instances --image-id ami-18f8df7d --security-group-ids sg-ID --subnet-id subnet-ID --count 1 --instance-type t2.micro --key-name KEY-NAME --user-data file://aws-user-data.sh --block-device-mappings 'DeviceName=/dev/sda1,Ebs={VolumeSize=10,DeleteOnTermination=false}' --query 'Instances[0].InstanceId' #stop ALL instances (only those are running) aws ec2 stop-instances --instance-ids `aws… Continue reading Using AWS EC2 CLI - part 2

Nextcloud - upgrade from CLI

Published on Author admin

Upgrading Nextcloud from CLI. /var/www/html/owncloud/ - Nextcloud installation directory apache - HTTP server service user cd /var/www/html/ wget https://download.nextcloud.com/server/prereleases/nextcloud-12.0.1RC4.zip service httpd stop rm owncloud-old/ -rf mv owncloud/ owncloud-old/ unzip nextcloud-12.0.1RC4.zip mv nextcloud/ owncloud/ mv owncloud-old/data/ owncloud/data/ cp owncloud-old/config/config.php owncloud/config/config.php chown apache: owncloud/ -R cd owncloud sudo -u apache php occ upgrade service httpd start

Bash swap function for swapping two files

Published on Author admin

Put following function definition code into ~/.bashrc file: function swap()         {     local TEMPFILENAME=tempfile.$$     mv "$1" $TEMPFILENAME && mv "$2" "$1" && mv $TEMPFILENAME $2 } Usage: swap FILE1 FILE2 This solution was originally found at: https://stackoverflow.com/questions/1115904/shortest-way-to-swap-two-files-in-bash/1115909#1115909

Port forwarding using HAproxy

Published on Author admin

HAproxy can be used not only for complex load-balancing scenarios, but also for simple port forwarding. Useful for forwarding packets originating from both local and external hosts. listen postgresql 0.0.0.0:5432     mode tcp     stats enable     balance roundrobin     server postgresql-db 192.168.0.1:5432 check