HP Printer install – HP LaserJet Pro MFP M26nw – ubuntu

1. Download and install https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
2. List on terminal the scanner/printer

 scanimage -L

device `hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100′ is a Hewlett-Packard HP_LaserJet_Pro_MFP_M26nw all-in-one
3. scanimage -d “hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100” –format tiff > image.tiff
4. convert to pdf
scanimage -d “hpaio:/net/HP_LaserJet_Pro_MFP_M26nw?ip=192.168.1.100” –format png –resolution 600 | convert png:- scan.pdf

Solve – cors problem


app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

app.get('/', function(req, res, next) {
  // ....
});

app.post('/', function(req, res, next) {
 // ....
});



Ubuntu dbVis – No suitable Java Virtual Machine could be found on your system

Error:

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8 and at most 9.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

Solution:

sudo apt update && sudo apt autoremove -y && sudo apt clean && sudo apt dist-upgrade -y && sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install oracle-java8-installer

React createElement – Warning: Unknown prop `childItems` on

The following command creates an element in React.


    const el = React.createElement(
                 < an html tag or react component >, 
                 < attributes or props or {} >, 
                 < children elements or text >
    )

When you pass a non html standard attributes in the second parameter to create html tag like div or p tag then a warning is raised of unknown prop. Simply remove the non standard attribute from the second parameter or pass empty object {}.

Ubuntu 17.10 expo and genymotion errors and solutions

Error:

Switched to a LAN URL because the tunnel appears to be down. Only devices in the same network can access the app. You can restart the project to try reconnecting.

Solution:

Due to some bug you must start xde (expo development environment) before genymotion. Also i needed to run xde from root user login. (not su or sudo ).
UPDATE: The following problem of adb version fixed this problem too.

===================================================================

Error:

Couldn’t start project on Android: could not install *smartsocket* listener: Address already in use
ADB server didn’t ACK
* failed to start daemon *
error: cannot connect to daemon

Solution:

the adb version on your system is different from the adb version on the android sdk platform-tools

1. check sys adb version

# adb version
Android Debug Bridge version 1.0.39

2. check sdk adb version

# cd /root/Android/Sdk/platform-tools
# ./adb version
Android Debug Bridge version 1.0.32

3. copy
# rm /usr/bin/adb
# sudo cp /root/Android/Sdk/platform-tools/adb /usr/bin/adb

=============================================================

Error:
Error: EACCES: permission denied, open ‘/tmp/haste-map-react-native-packager-1-8963e41d25a58e25717f5939e5144fc2

Solution: sudo rm /tmp/haste-map-react-native-packager-1-8963e41d25a58e25717f5939e5144fc2

========================================================
Error:
The development server returned response error code: 500

Solution:
For me this error was resolved running yarn in the project folder. The cause may have been due to the fact that I’d switched branches and some of the packages were not installed.

Reset windows 8 password from Ubuntu – Metadata kept in Windows cache, refused to mount

It was an interesting task to reset windows 8 password on a machine running Ubuntu . When I tried to (re)mount the disk I got the following problem and after googling for a while I found that there was no viable solution but to reinstall windows. However I successfully reset the password by using the following techniques.

I removed hard disk from the windows computer and attached it to my laptop running Ubuntu 17.10. By default Ubuntu mounts new hard disk as read only (or if any error) and therefore I have to remount the disk as read-write but I got the following error during mounting.

Metadata kept in Windows cache, refused to mount. ..

Windows machine had errors or hibernated files and therefore did not allow to mount as read-write. I used the following commands (alternatively, please unmount all partitions if mounted auto by Linux) a couple of times to fix this.

   sudo mount -t ntfs-3g -o remove_hiberfile /dev/sda5  ~/win8/
   sudo ntfsfix /dev/sda5

After this I installed the command line tool by:

  sudo apt install chntpw

Now first list the Windows users and then make password blank by:

   cd ~/win8/Windows/System32/config/
   sudo chntpw -l SAM
   sudo chntpw -u Administratör SAM

The funny part starts now. The administrator user was written with Swedish character ‘ö’ i.e Administratör and it was’nt recognized as in the last command above.

A work around is to use RID which is displayed when listing Windows users ( command : sudo chntpw -l SAM ).

   sudo chntpw -u 0x01f5 SAM

From the menu shown after the above command choose the one with blanking password, press q and (yes) for saving changes.