Downloading Lejos Firmware w/ eclipse plug-in (Linux Mint 17.3) - linux

So I've just switched to d to Linux Mint rosa from Windows 10. I'm trying to figure out how download the firmware through eclipse. Whenever I click the plug-in and then the firmware I get;
"starting nxjflashg failed
org.lejos.nxt.ldt.util.LeJOSNXJException: NXJ_HOME is not set. Please specify it in the plug-in's preferences
See Eclipse error log for detailed stack trace."
I know when I was using windows 10 I had to change environmental variables and download the NXJ drivers also, I'm not sure how to do this w/ Linux

You have 3 steps to flash a NXT on Linux with eclipse (once Java is working):
install the libusb driver
install LeJOS
install the LeJOS eclipse pugin
I think you only installed the eclipse plugin, so you need to follow the instructions here : http://www.lejos.org/nxt/nxj/tutorial/Preliminaries/GettingStartedLinux.htm
Summary :
sudo apt-get install libusb-dev ant (install libusb driver and ant, a kind of make for java)
download leJOS, unizp it and put it where you want (/opt for instance)
set the NXT_HOME in the window > Preferences > leJOS NXT > NXJ_HOME to the path you copied leJOS
run ant in $NXJ_HOME/build to build the usb driver
to access to your USB port without su rights
edit your udev rules (1)
add your user to the group lego (sudo groupadd lego && sudo gpasswd -a $USER lego)
log out and log in to update the rules
(1) udev rule : vim /etc/udev/rules.d/70-lego.rules
# Lego NXT brick in normal mode
SUBSYSTEM=="usb", DRIVER=="usb", ATTRS{idVendor}=="0694", ATTRS{idProduct}=="0002", GROUP="lego", MODE="0660"
# Lego NXT brick in firmware update mode (Atmel SAM-BA mode)
SUBSYSTEM=="usb", DRIVER=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", GROUP="lego", MODE="0660"

Related

Linux add printers via terminal using lpadmin command

I use cups to add printer to my Linux machine it is easy to add via localhost:631 on the browser but i wanna add it using terminal alone there is a command to do that lpadmin -p printername -v device_uri -m everywhere when I run this command uli get a error
"lpadmin:Printer drivers are deprecated and will stop working in a future version of cups
lpadmin : unable to copy ppd files"
Is there any other way I could add printer with correct driver on Linux machine using terminal only?

Rebranding Centos Linux 7 with changing branding of centos name from /etc/os-release, grub boot loader

For rebranding Centos 7 recently started changing required OS components, except few things everything works as expected. At the first stage of the installation process shows like so,
**CustomOS**
Install CustomOS 7
Test this media & install CustomOS7
But after select Install CustomOS 7 OS boots up with pre checking all configuration and shows welcome to Centos Linux 7,
Welcome to Centos Linux 7(Core)
Which is required to change Centos Linux 7 to Custom Linux 7. To achieve goal already done few things successfully by following RedHat document, Talk:Build an Official ISO and few other blogs but mentioned required changes doesn't work as requiremnt. Also following requirements need to do,
after completion of OS installation Gurb boot loader will show Custom OS instead of Centos
cat /etc/os-release will show Custom OS instead of Centos
You have to modify centos-release.spec file for your required changes. Follow the below instructions.
Prepare Environment:
# yum install rpm-build gcc make
# mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
# echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
Extract Source RPM:
# rpmbuild --rebuild centos-release-7-9.2009.0.el7.centos.src.rpm
Install Source RPM:
# rpm -ivh centos-release-7-9.2009.0.el7.centos.src.rpm
Modify centos-release.spec file:
# cd ~/rpmbuild/SPECS/
# vim centos-release.spec
%define product_family CustomOS Linux
Build RPM:
# cd ~/rpmbuild
# rpmbuild -ba SPECS/centos-release.spec
# cd ~/rpmbuild/RPMS/x86_64
Copy centos-release-7-9.2009.0.el7.centos.rpm and replace this with existing one. Then build your OS.

android studio doesn't detect my device on my ubuntu laptop

I am trying to run an app from Android Studio on my Ubuntu laptop.
I have enabled USB debugging, but it is still not working.
When I press run in Android Studio, it does not detect my device (LG G3 Lollipop).
I could not find any help :(
First of all,
Open terminal and do following:
Do lsusb command to check your device is indeed connected.
Do adb devices to check if your device is connected then it is detected as in adb mode.
2.a. if the above command is not found, do sudo apt-get install android-tools-adb and then check if it is listed.
Secondly, post results of step 1 and 2 with your question to help us in finding a correct solution.
Troubleshooting:
Make sure adb mode in enabled.
Make sure you have opted for Allow option when prompted for in your device upon connecting to your ubuntu system.
This one is from some past LG users, Try connecting your device in PTP mode rather than MTP mode, it surprisingly works.
If it atill doesn't work, (most likely your case), try googling. I landed upon this page by pressing I'M FEELING LUCKY, you should try to feel lucky once in a while.
Source for step number 3 and 4
follow the steps as mentioned upon page:
Create a file: /etc/udev/rules.d/70-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
As a second step of troubleshooting (make sure you again repeated troubleshooting from step1 in case you failed at this step)
Again, the process:
Create a file: /etc/udev/rules.d/51-android.rules.
Write: SUBSYSTEM=="usb", ATTR{idProduct}=="1004", MODE="0666" to the file.
Assign proper permission via sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Reboot the system and restart udev.
Make sure you have adb installed in your ubuntu system.
If not then type -
sudo apt-get install adb
Provide your system password and press 'Y' asked during installation process.
Then disconnect your device through USB and then reconnect it.
You will have to grant permission for debugging which prompts on your device just after reconnecting.
I faced the same issue but it was my mistake. I didn't turn on the " USB DEBUGGING MODE ".
Settings > Developer Option > Enable USB Debugging Mode.
Try to revoke USB debugging authorizations and then connect your device, it should show permission prompt for authorization.
go to
settings -> developer options -> revoke USB debugging authorizations.
I tried restarting adb using root priviledges and it worked for me. Use these commands in the terminal:
sudo adb kill-server
sudo adb start-server
Hope it works for you too...
For my situation with Ubuntu 16.04, with my device properly connected via USB, confirmed by lsusb
The solution is let the Studio aware of the Android/Sdk folder by defining
export ANDROID_HOME=<the Android/Sdk folder>
in ~/.bashrc
(I have installed the SDK at a custom location)
Then start a new shell, from there re-start the studio, then it works.
I solved with this: https://stackoverflow.com/a/37109216/5081063
If the problem is only on Android Studio and not in your OS you can solve with that.
So first check if adb recognize any devices with:
$ adb devices
If yes, open Android Studio and follow these steps:
Go to Run > Edit Configurations...
Under Deployment Target Options select Show Device Chooser Dialog from the drop-down-list
if you are doing it first time in Ubuntu Linux, then Use sudo apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.
or, use
sudo adb kill-server
sudo adb start-server
and check using
sudo adb devices
you can also check uncheck the usb debugging option, in your developer option in the phone.
follow this link for more info.
Run apps on a hardware device
Enable USB Debugging from Settings->Developer Options
Enable Developer Mode by clicking on build number several times
My device appeared as unrecognized and when I ran adb devices fom android-tools directory it said: adb not a command. Strange. So what I did is installed adb tools additionally and then run adb devices:
sudo apt-get install android-tools-adb
89LY0810Y unauthorized
Then I saw the dialog on my device and selected: Always authorize.
Please make sure your device is in debug mode.
If you have tried many terminal commands to connect your physical device to android studio in ubuntu and you failed to connect try this :- Connect your device and change your USB preference(device notification) to PTP,android studio will detect your device.see this image
I had the same problem, as I had enabled the USB Debugger but it was my first try so I didn't know what to expect. If you answer "yes" to "use as storage device," you will set it to mtp, if you answer no, after that you will have the option to connect on debug mode and it will appear.
I was using a Samsung A31 and Debian
After trying a lot of different solutions, I notice that the problem was my cable, so I changed it and now it works.
Thanks to RazorHail Answer.

How to set up Virtualbox 1366x768 resolution for a Linux guest?

I have been trying maybe weeks now to figure out how to configure VirtualBox to have 1366x768 resolution on a linux guest, which is on a windows 8.1 host.
My configuration:
Windows 8.1 as host
Linuxmint 17.1 as guest (tried ubuntu and debian too but no luck)
Virtualbox 4.3.26 and its extension pack
Laptop is powerful with 16GB ram and 4GB Nvdia
My problem is that it doesn't matter what I used, nothing worked.
Please do not post the answers on most known websites, I tried them already.
Once your VM is started, you need to run the VBox Linux Guest Additions.
First try to run it from the VirtualBox window's menu:
Devices >> Insert guest Additions CD image...
and follow the instructions.
If that fails, open a terminal and go to the directory where you CD reader is mounted (/run/media/ on Fedora or /media/ on Ubuntu for example).
Then type command sudo ./VBoxLinuxAdditions.run
Complete instructions can be found on the VirtualBox user manual
Once Guest Additions are installed, reboot your virtual machine. You should be able to resize your screen to your heart's content.
I installed the new VirtualBox 5.0.0_BETA2 and it solved my all problems. Great product is getting ready! Cant wait the latest release. more than a PERFECT software. Now you can remove top bar and/or bottom bar easily. Show what you need.
If you are having problem like me with 1366x768 I recommend you to install latest versin of VB even if it is Beta!

grub can't see linux\no boot menu in Win7

I have both windows and linux installed.
I created a new partition but got Grub error:UNKNOWN FILESYSTEM on restart. Then I used windows recovery CD and Bootrec/fixmbr command to get Grub menu back.
But now I don't see the boot menu.laptop simply boots into windows, also I am unable to boot from any other CD or USB
You need to reinstall grub on the boot sector. If you use Ubuntu, there is a very easy way to fix it with Ubuntu's live CD using the boot-repair tool.
I'm not sure if this will work with other Linux distributions but It's worth trying.
If you can't boot from CD or USB you should check your boot priority in the BIOS. Or try to get to boot selection menu (usually by pressing F12) and choose CD\USB over there, anyways, the answer here is in the BIOS and not related to the grub

Resources