Using adb with a OnePlus X on Linux…

… is not really that hard. Just annoying. Since OnePlus’ USB ID is not in the default adb list, you need to add it yourself:
echo "0x2a70" >> ~/.android/adb_usb.ini
where 0x2a70 is the identifier for OnePlus. (you can find this with lsusb)

To add automatic permissions to the device node when it’s created, add this udev rule to /etc/udev/rules.d/51-android.rules (all on one line):

SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", MODE="0666", GROUP="plugdev" ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011|f003", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

Reset android lockscreen to slide

You’ve just reconfigured the security lockscreen settings on your (rooted) android phone, and then forgotten eg. the PIN code to unlock it? It happened to me yesterday.

Luckely(?) there’s an easy way around it, if you have adb activated:

Connect your phone to your computer, and do this:

adb shell
su
rm /data/system/locksettings.db*
reboot

This will basically delete the lockscreen settings database, which will make it revert to the default setting (slide to unlock).

This does mean that if you have adb enabled by default on your phone, the lockscreen is defeated very easily. So don’t depend on it with your life.