How to solve apt-get command not found - linux

Hi i am a new with ubuntu and linux,I'm working on baxter robot i have couple problems ..
As i follow the guide steps i have a command that i need to edit a gedit file and write my pc's hostname & ip_address :
gedit baxter.sh
i did it couple times and when i make the ssh connection when i write :
. baxter.sh
i get a not :
EXITING - Please edit this file, modifying the 'baxter_hostname' variable to reflect Baxter's current hostname.
after that i get error on rosrun,apt-get,rosnode commands
sudo: apt-get command not found
it worked ones when i changed baxter.sh ip address and hostname for first time and that time i didnt get that note, i dont know if that relevant just for more information .
thnx for help

To fix
EXITING - Please edit this file, modifying the 'baxter_hostname' variable to reflect Baxter's current hostname.
The first step is to make sure you set the baxter hostname. Per the baxter sdk guide:
Baxter's hostname is defaulted as the robot's serial number. The serial number can be located on the back of the robot, next to the power button.
Alternatively, you can find your robot's hostname by plugging a USB keyboard into the back of Baxter and pressing Ctrl+Alt+F3.
You can edit this by opening the file in your terminal (via gedit) or you can navigate to the file using your file browser and change it in a text editor.
To fix
sudo: apt-get command not found
Checkout some of the documentation on the baxter.sh script.

Related

PsExec - The file cannot be accessed by the system

I'm trying to execute a .bat File on a Server in a local network with psexec
I'm currently trying with this command:
.\PsExec.exe -i -u Administrator \\192.168.4.36 -s -d cmd.exe -c "Z:\NX_SystemSetup\test.bat"
The server has no password (it has no internet connection and is running a clean install of Windows Server 2016), so I'm currently not entering one, and when a password is asked I simply press enter, which seems to work. Also, the .bat File currently only opens notepad on execution.
When I enter this command, I get the message "The file cannot be acessed by the system"
I've tried executing it with powershell with administrator privileges (and also without, since I saw another user on Stackoverflow mention that it only worked for them that way) but to no success.
I'm guessing this is a privilege problem, since it "can't be accessed", which would indicate to me that the file was indeed found.
I used net share in a cmd and it says that C:\ on my server is shared.
The file I'm trying to copy is also not in any kind of restricted folder.
Any ideas what else I could try?
EDIT:
I have done a lot more troubleshooting.
On the Server, I went into the firewall settings and opened TCP Port 135 and 445 explicitly, since according to google, PsExec uses these.
Also on the Server, I opened Properties of the "windows" Folder in C: and added an admin$ share, where I gave everyone all rights to the folder (stupid ik but I'm desperate for this to work)
Also played around a bunch more with different commands. Not even .\PsExec.exe \\192.168.4.36 ipconfig seems to work. I still get the same error. "The file cannot be accessed by the system"
This is honestly maddening. There is no known documentation of this error on the internet. Searching explicitly for "File cannot be accessed" still only brings up results for "File cannot be found" and similar.
I'm surely just missing something obvious. Right?
EDIT 2
I also tried adding the domain name in front of the username. I checked the domain by using set user in cmd on the server.
.\PsExec.exe \\192.168.4.16 -u DomainName\Administrator -p ~ -c "C:\Users\UserName\Documents\Mellanox Update.bat"
-p ~
seems to work for the password, so I added that.
I also tried creating a shortcut of the .bat File, and executing it as Administrator, using it instead of the original .bat File. The error stays the same "The File cannot be accessed by the system"
As additional info, the PC I'm trying to send the command from has Windows 10, the Server is running Windows Server 2016
So, the reason for this specific error is as simple and as stupid as it gets.
Turns out I was using the wrong IP. The IP I was using is an IPMI Address, which does not allow for any traffic (other than IPMI related stuff)
I have not yet gotten it to work yet, since I've run into some different errors, but the original question/problem has been resolved.

How to make Named work at boot to resolve DNS queries (possible crontab entry)

Hi I'm a student at Seneca in the OPS335 right now and I'm new here, so basically I setup a new DNS server on my Centos7 machine and got it working perfectly, all the zones in named.conf are setup right, all the records and files are in place, the ifcfg-ens33 and resolv.conf files are all set with the right 'IPs', 'DNS1' and 'namserver', 'search' parameters. The service is enabled to start at boot, but when i get to my terminal and try pinging google.ca or a host command it will not resolve until i manually restart the services even though they are active. Iptables are set to allow it in and out via its port (53). If anyone knows how to fix this please help me out, otherwise i had another idea with crontab.
Any help would be greatly appreciated.
So in order for me to make what i have work is to manually restart the iptables libvirtd and named services in that order, so i made a small script to do this and then tried adding it to crontab after testing it in terminal. I made it to restart the service at reboot and it works in the terminal, but when i try adding it to crontab with a new line at the end as :
#reboot /namedrestart2.bash
it does not work, named boots and is active and enabled, but it still will not resolve DNS queries.
I am not sure if i have the right PATH and SHELL set for crontab mine is :
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
SHELL=/bin/sh
MAILTO=root
The main result that i want is for named to boot properly so i dont have to go through this restart service hassle.
Again any help would be greatly appreciated.

raspberry pi's linux agent unable to connect cumulocity platform

I am trying to connect my cumulocity-rpi-agent to cumulocity so that I can have two options either accept or cancel. But right now I am unable to to see accpet option for my device.
1) wget http://resources.cumulocity.com/examples/cumulocity-rpi-agent-latest.deb
2) sudo dpkg -i cumulocity-rpi-agent-latest.deb
I have executed these commands
then i have hit dpkg --list list command and cumulocity-rpi-agent now visible in result.
But my problem begins after above steps and can't proceed to next (When agent is installed, you should update the configuration file which is usually located at "./cfg/cumulocity-config.properties" and fill the host property value. Open Cumulocity in a web browser and go to the "Registration" page. Enter the serial number that you wrote down in the previous step and click "Register Device".)
I cant find ./cfg/cumulocity-config.properties these directory and file after installation
I refereed and followed https://www.cumulocity.com/guides/devices/raspberry-pi/ this link
I hit the sudo rebbot to get the accept button on cumulocity platform to accept device
I found this file on /usr/share/cumulocity-rpi-agent/cfg on this location

Can you help me access Mac SMB share from Ubuntu using smbclient? (NT_STATUS_ACCESS_DENIED error)

I've been working on a file server product that uses smbcilent to transfer files between client computers and the server. It's been working great so far with our LAMP (Ubuntu) server and Windows machines.
I'm currently trying to expand the setup to include Mac's, but am having trouble with the server accessing the share on the Mac.
Here's my command and error (bracketed descriptions replace private info):
# smbclient //10.101.0.7/[share-file] -U [username]%[password] -c ls
WARNING: The "syslog" option is deprecated
NTLMSSP packet check failed due to short signature (0 bytes)!
NTLMSSP NTLM2 packet check failed due to invalid signature!
session setup failed: NT_STATUS_ACCESS_DENIED
Things I've tried:
✓ Accessing share using a Windows machine to ensure the share is setup properly - check! Works fine there.
✓ Invoking -S off or --signing=off in the command - no change.
✓ Just looking at the shares first using smbclient -L 10.101.0.7 -U [username]%[password] - same error.
✓ Googling for an answer - check! Several people with similar problems, but no working solutions so far.
The most promising thing I've see so far involves compiling smbclient 4.4 from sources and running that with no authentication (-U ""%""), but that seems like a temporary solution based on a bug rather than a solid plan that will work for a long time. (But I'll try that next if I can't find any better ideas...)
Thanks for reading and trying to help!
Try adding --option="ntlmssp_client:force_old_spnego = yes" to the smbclient command as suggested on the samba-technical mailing list.
For me, this now lists shares on a Mac OSX server:
smbclient -U$user%$password -L $mac_host --option="ntlmssp_client:force_old_spnego = yes"
For mounting, you may need to add the nounix,sec=ntlmssp options as in
sudo mount -t cifs //$mac_host/$share $mountpoint -o nounix,sec=ntlmssp,username=$user,password=$password
On recent versions of MacOS (e.g. Monterey) it is necessary to do several configuration steps to enable smb access from Linux:
Open System Preferences.
Select Sharing.
Select File Sharing.
Ensure that the directory is listed in Shared Folders.
Right-click/two-finger click on the share directory.
Click on Advanced Options
Ensure Only allow SMB encrypted connections is checked.
Click OK
Click on Options
Click on the checkbox for Share files and folders using SMB.
Under Windows File Sharing ensure the appropriate user is checked.
Type the user's password in the 'Authenticate' dialog bo and press 'OK'.
Click 'Done'.
You should now be able to connect from Linux to the MacOS share using the commands given by #mivk.

noVNC Multiple Localhost Servers

Ive got 4 dev VMs for four projects (all VMware Player VMs w/ubuntu 15.04 host) where each is running VNC (ports 5900, 5901, 5902, 5903) respectively.
I downloaded noVNC and saved to /var/www/html (my apache2 server on same host). Based on the ReadMe I then ran on my terminal
./utils/launch.sh --vnc localhost:5900
I received a missing websockify error, so downloaded it and placed it into the util folder. I then ran the same command and it worked! The terminal told me to Navigate to a url and sure enough I could control my VM.
However -- I'm wondering how can I use noVnc to access all 4 VM's? Is there some simple way to extend the port to a range like in iptables or firewalld?
./utils/launch.sh --vnc localhost:5900-5903
Okay, Ill answer for myself here in case it helps someone in the future...
First, create a token file where each line has a nickname, ip address, and port.
I created a file named token.list where each line looks like:
localhostnickname1: localhost:5900
localhostnickname2: localhost:5901
...
Then I use my terminal to go into the websockify folder so I can see the run file. I issue it the command:
./run --web /path/to/noVNC --target-config /path/to/token.list localhost:6080
Finally, I open my web browser and go to :
http://localhost:6080/vnc_auto.html?path=?token=localhostnickname1
Where localhost1 is the nickname of my first server on the first line of token.list
This link was my reference. If you want to serve this outside of localhost -- change the parameter localhost:8060 from localhost to an IP

Resources