Categories
Open Source OsX RabbitMq Solutions Web

RabbitMQ Server – Issue with High Sierra – Mac OS

After updating to High Sierra, I faced issues with starting rabbitmq-server.  The command gave the following error:

RabbitMQ 3.6.3. Copyright (C) 2007-2016 Pivotal Software, Inc.
## ## Licensed under the MPL. See http://www.rabbitmq.com/
## ##
########## Logs: /usr/local/var/log/rabbitmq/rabbit@localhost.log
###### ## /usr/local/var/log/rabbitmq/rabbit@localhost-sasl.log
##########
Starting broker...
completed with 10 plugins.
Assertion failed: (ctx), function digest_update, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.20.5/apple/crypto/digests.c, line 49.
/usr/local/sbin/rabbitmq-server: line 236: 2681 Abort trap: 6 start_rabbitmq_server "$@"

I narrowed down the issue to a problem with Home Brew. I had installed rabbitmq via HomeBrew a while back and with the changes in the operating system rabbitmq was failing to start.

Running the following command gave the below error message:

$ brew update
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
sudo chown -R $(whoami) /usr/local

How to fix RabbitMQ Server – Issue with High Sierra

  1. Reinstall Home Brew using the following command:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Then run:
    brew update
  3. Then run:
    brew reinstall rabbitmq
  4. Once done you must  be able to run rabbitmq-server to get the server up and running.
Categories
Android Apps Device Open Source Solutions

Swift Key – Turn Off Keyboard Touch Vibration

Swift Key is one of the best keyboards for Android and IOs. By default, its configured to enable vibration on key press (usually it takes the system defaults). If you are someone who dislikes this feature, here is a simple way to turn off keyboard touch vibration in it:

Steps to Disable Keyboard Touch Vibration in Swift Key:

  • Go to Home -> Settings -> Language & input

    Android Settings Page
    Android Settings Page
  • Tap on “Virtual Keyboard”
    Android Language & input
  • Locate “SwiftKey Keyboard” in the list and tap it
    Virtual Keyboard Menu
  • This will open the SwiftKey Settings… Tap on “Typing”
    Swiftkey Settings
  • Tap on “Sound & Vibration”
    Swiftkey Sound and Vibration Menu
  • Turn off “Keypress Vibration” & “Use the Android default vibration”
    Disable Vibration in SwiftKey
Categories
Linux MySql Open Source Solutions

How to Rename Column in Mysql

Modifying database schemas is a routine task, but the exact syntax to alter structural properties varies heavily across database versions. If you are trying to rename a column in MySQL, using the wrong command can lead to syntax errors or accidental data loss.

How you rename a column depends entirely on whether your environment runs modern MySQL 8.0+ engines or legacy MySQL 5.7 configurations.

Here is the exact syntax and production-ready code blocks to rename your database columns safely.

The Modern Way: MySQL 8.0+ (RENAME COLUMN)

If you are running MySQL 8.0 or newer, the development team introduced a native, simplified syntax. You no longer need to re-specify the entire data type definition just to change the column name.

SQL

ALTER TABLE table_name
RENAME COLUMN old_column_name TO new_column_name

Example: To change a column named user_pass to password inside a table called users:

SQL

ALTER TABLE users 
RENAME COLUMN user_pass TO password;

The Legacy Way: MySQL 5.7 and Older (CHANGE)

In older versions of MySQL, the RENAME COLUMN statement does not exist. Attempting to use it triggers a generic syntax error. Instead, you must use the CHANGE clause.

Crucially, you must explicitly re-state the complete data type definition along with any attributes (like NOT NULL or DEFAULT). Failing to include the data type will break the query.

SQL

ALTER TABLE table_name 
CHANGE old_column_name new_column_name DATA_TYPE CHARACTER_SET_ATTRIBUTES;

Example: To rename user_pass to password where the column data type is a VARCHAR(255) that cannot be null:

SQL

ALTER TABLE users 
CHANGE user_pass password VARCHAR(255) NOT NULL;

Warning: Be extremely careful when using CHANGE. If you accidentally specify a different data type definition during the rename step, MySQL will attempt to convert the underlying data, which can lead to truncated strings or corrupted records.

Can I rename multiple columns at once in MySQL?

Yes, in modern MySQL 8.0, you can chain operations within a single statement by separating them with commas. For example: ALTER TABLE users RENAME COLUMN old_a TO new_a, RENAME COLUMN old_b TO new_b;.

Why does MySQL rename column throw a syntax error?

This typically happens if you try to use the native RENAME COLUMN syntax on a server running an older version like MySQL 5.7. For legacy setups, you must use the ALTER TABLE CHANGE statement instead

Categories
JavaScript Open Source Solutions Web

JavaScript Date Format YYYY-MM-DD

Here is a simple function that takes the input of JS Date and returns a string of format YYYY-MM-DD:

var getDateFromDateTime = function(date) {
date = new Date(date); //Using this we can convert any date format to JS Date
var mm = date.getMonth() + 1; // getMonth() is zero-based
var dd = date.getDate();
if(mm<10){ mm="0"+mm; } if(dd<10){ dd="0"+dd; } return [date.getFullYear(), mm, dd].join('-'); // padding };

Categories
JavaScript Open Source Solutions Web

Convert JavaScript Date format YYYYMMDD

Here is a simple function that takes the input of JS Date and returns a string of format YYYYMMDD:

var getDateFromDateTime = function(date) {
date = new Date(date); //Using this we can convert any date format to JS Date
var mm = date.getMonth() + 1; // getMonth() is zero-based
var dd = date.getDate();
if(mm<10){ mm="0"+mm; } if(dd<10){ dd="0"+dd; } return [date.getFullYear(), mm, dd].join(''); // padding };