Drupal 8 → Reset any User's password

Many thanks to Tony Mucci for this simple solution for Drupal8 Passwd resets: From: https://medium.com/code-kings/drupal-8-how-to-manually-reset-an-admin-password-on-centos-e322b59ad307

Drupal 8 → Reset a user password

  1. Log into Mysql (I used phpmyadmin for all SQL steps) and go to your Drupal’s schema
  2. Find the users_field_data table
  3. Find the user that is related to you.
  4. Log into your terminal
  5. Go to your Drupal main directory
  6. Run this command:
    php core/scripts/password-hash.sh “NewPasswordHere”
  7. Don’t forget the quotes in the above example
  8. It will create a hash you can use in your database.
  9. Go back to your DB table
  10. Replace the pass value with your new hash. Save/update your table’s row.
  11. Go to flood table in DB
  12. If you are running a non-production server, simply truncate this table, otherwise look for anything that is flagging your IP with logging in. delete those records.
  13. Go to cache_entity table in DB
  14. If you are running a non-production server, simply truncate this table, otherwise look for anything that is flagging your IP with logging in. delete those records.
16 Jun 2017

My New Toy: The Raspberry Pi 3 Model B

The Raspberry Pi 3 Model B is the third generation Raspberry Pi with a 64-bit 1.2GHz quad-core processor, 1GB of RAM, WiFi (b/g/n), and Bluetooth 4.1! The latest Raspberry Pi retains the same overall form factor as previous models ensuring compatibility with existing add-on boards (HATs) however some minor changes to the layout and more powerful processor mean we've redesigned our Pibow case. 1.2GHz 64-bit quad-core ARM Cortex-A53 CPU (BCM2837) 1GB RAM (LPDDR2 SDRAM) On-board Wireless LAN - 2.4 GHz 802.11 b/g/n (BCM43438) On-board Bluetooth 4.1 + HS Low-energy (BLE) (BCM43438) 4 x USB 2.0 ports 10/100 Ethernet 40 GPIO pins Full size HDMI 1.3a port Combined 3.5mm analog audio and composite video jack Camera interface (CSI) Display interface (DSI) microSD slot VideoCore IV multimedia/3D graphics core @ 400MHz/300MHz With the ARMv8 processor it can run the full range of ARM GNU/Linux distributions, including Snappy Ubuntu Core, as well as Microsoft Windows 10 IoT edition.
31 Jan 2017

Another toy - testing NGINX as a web server

root@pve:/var/lib/vz/dump# pct restore -storage local-lvm --rootfs 4 300 vzdump-lxc-200-2016_11_19-12_23_24.tar.gz
  Logical volume "vm-300-disk-1" created.
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done                            
Creating filesystem with 1048576 4k blocks and 262144 inodes
Filesystem UUID: 602ba375-c829-40d2-a1bb-8275d5ce9407
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Multiple mount protection is enabled with update interval 5 seconds.
Writing superblocks and filesystem accounting information: done 

extracting archive '/var/lib/vz/dump/vzdump-lxc-200-2016_11_19-12_23_24.tar.gz'
Total bytes read: 1808404480 (1.7GiB, 29MiB/s)
Detected container architecture: amd64
19 Nov 2016

Removing dead tracks from itunes

This was very useful for a corrupted song db in itunes: You can use a playlist to collect dead tracks. Create new regular playlist – Playlist1 Select whole library and drag to Playlist1 Create new Smart Playlist with the rule: Playlist is not Playlist1 Live updating checked – after you run it, uncheck live updating or you may not be able to delete tracks. This playlist should contain all the dead tracks Use shift-del to remove from library
18 Jun 2016

Proxmox convert from OpenVZ to LXC

This is a bit exciting for me - less so for anyone else I guess :( But it has taken me a while to get to this point. Took a snapshot backup from the office proxmox V3.x server, and brought it home t o convert to LXC (Linux Container) format on a proxmox 4.2 server (apparently LXC is the go nowadays - who knew?) Here's the magic bit:
root@pve:/var/lib/vz/dump# pct restore 100 -storage local-lvm vzdump-openvz.tar.gz Logical volume "vm-100-disk-1" created. mke2fs 1.42.12 (29-Aug-2014) Creating filesystem with 1835008 4k blocks and 458752 inodes Filesystem UUID: b297212a-5d45-4ded-9a5a-44d7eaa246f9 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Multiple mount protection is enabled with update interval 5 seconds. Writing superblocks and filesystem accounting information: done extracting archive '/var/lib/vz/dump/vzdump-openvz-100-2016_05_17-13_55_00.tar.gz' Total bytes read: 5954232320 (5.6GiB, 34MiB/s) Detected container architecture: i386 ########################################################### Converting OpenVZ configuration to LXC. Please check the configuration and reconfigure the network. ########################################################### root@pve:/var/lib/vz/dump#
12 Jun 2016

Saved: Proxmox Linux Header updates caused boot failures

I have been grappling with this for a while - turns out it was something very simple:
grub-mkdevicemap -n update-grub
root@pve:~# grub-mkdevicemap -n root@pve:~# update-grub Generating grub configuration file ... Found linux image: /boot/vmlinuz-2.6.32-39-pve Found initrd image: /boot/initrd.img-2.6.32-39-pve Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin done
Some other useful links for Proxmox setup: https://pve.proxmox.com/wiki/Package_repositories And to remove the "No Subscription" messages: https://www.jamescoyle.net/how-to/614-remove-the-proxmox-no-subscription-message
03 May 2016

Notes from boot-repair utility

I have always found the boot area a difficult one to understand. Take this link as an example: http://paste.ubuntu.com/11527748/ And AFTER the repair: http://paste.ubuntu.com/11527984/ <-- This one Failed... Another try - it inlcuded a re-install of Grub Please write on a paper the following URL: http://paste.ubuntu.com/11529742/ That's the out put from my laptop after I munged the disk arrangement adding a larger drive.

install Boot-Repair in Ubuntu

- either from an Ubuntu live-session (boot your computer on a Ubuntu live-CD or live-USB then choose "Try Ubuntu") or from your installed Ubuntu session (if you can access it) - connect to the Internet - open a new Terminal, then type the following commands (press Enter after each line): sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair && boot-repair
02 Jun 2015

If you accidentally remove the 0 user (UID = 0) in DRUPAL 6

Will typically give you and error message like this:
Could not login with user ID #0. This is typically caused by importing a MySQL database dump from a faulty tool [error] which re-numbered the anonymous user ID in the users table. See http://drupal.org/node/1029506 for help recovering from this situation.
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; INSERT INTO `users` (`uid`, `name`, `pass`, `mail`, `mode`, `sort`, `threshold`, `theme`, `signature`, `created`, `access`, `login`, `status`, `timezone`, `language`, `picture`, `init`, `data`) VALUES ('0', '', '', '', 0, 0, 0, '', '', 0, 0, 0, 0, NULL, '', '', '', NULL);
01 Feb 2015
Subscribe to