Running test with "usbtest" on Ubuntu - module

i am newbie to these modules and device drivers and all.I would like run some sample tests on ubuntu main tree USB driver. I have seen this document and was trying to do the same.I do inserted the "usbtest" module and while trying to run
usbtest
command, terminal says the command not found
I have tried to insert g_zero module by running
modprobe g_zero
,but it says
modprobe: ERROR: could not insert 'g_zero': No such device
and
modprobe --force g_zero says
modprobe: ERROR: could not insert 'g_zero': Exec format error
Anyone Please post better simple explanation..
I'm using Ubuntu 14.04.3 LTS and my kernel is 3.13.0-24-generic
Also please suggest any method to test linux main tree drivers through command line.

Related

Pyodbc Azure sql database

I am using a macOs BigSur, and I would like to use python to connect to azure sql database.
I followed Microsoft documentation:
https://learn.microsoft.com/en-us/python/api/overview/azure/sql?view=azure-python
to set all the configuration and installed all the requirement for the Mac OS following this documentation.
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver15
but when I run my python script I get this error:
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")
I install mssql-tools and unixodbc
and if I run the command odbcinst -j
I get back this output:
unixODBC 2.3.9
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/<my-user>/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
Anyone has a clue about this error? and please if you need more infos just ask me. Thank you so much
EDIT:
Following the documentation, Microsoft suggests to make a sim link out of the odic.ini and odbcinst.ini.
I run the code to create those symlinks but I realised that if I try to open those files, they are empty, and if I try to go to the folder and open them manually rather than with terminal, I get the error that it can't be done because the source doesn't exist.
Did anyone ever occurred in this error?
LATEST UPDATE:
I installed FreeTDS and updated my .odbc.ini with the following configuration:
[my_server]
Description = my_server
TDS_Version = 7.4
Driver = /usr/local/lib/libtdsodbc.so
Server = YOUR.SERVERNAME.HERE.com
Port = 1433
When I run my python script to connect to the database, I get the following Traceback:
Traceback (most recent call last):
File "database.py", line 11, in <module>
cnxn = pyodbc.connect('dsn=my_server;'
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libtdsodbc.so' : file not found (0) (SQLDriverConnect)")
And in fact there is no libtdsodbc.so in that location.
In another topic they suggest to install freeTDS with the flag --with-unixodbc but when I try to do so, I get the error that the command doesn't exist
UPDATE
If your macos is on the x64 architecture, you can use below method to solve issues.
If you use M1, it's not support now.
Solution for x64 architecture.
Run below code, it should useful to you.
brew update
brew install unixodbc
brew install FreeTDS
Then update the .odbc.ini file.
For more details, please refer below blogs.
How to set up ODBC in Mac OS to connect to MS SQL Server for use with Python and R
Starting ODBC version 17.8, Apple M1 is supported.
You can install ODBC 18 on macOS with the following commands:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql18 mssql-tools18

Android emulator tear down during tests run

guys!
I run my Android tests with Appium on Android emulator. Where I run my tests in sequence emulator sometimes tear down and remaining tests are ignored.
In Appium logs i see this error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'
Is there anybody face with such problem?
You are trying to run an adb-shell command which is not allowed.
Appium has some in-secure commands that normally it will not allow them to be used.
You can see the commands here: Appium Insecure Features
The adb-shell commands (to change the system settings) is one of them.
Follow the link to how to prevent appium checking this.
How to resolve:
At the beginning of test setup, run this commnad: appium --relaxed-security with command line. Then the appium let you using the insecure feautures during the test.
for example in pyhton you should run os.system(appium --relaxed-security (while having appium directory in the system environment variables path.

How can I solve this problem of installation xampp on fedora?

When I run xampp on fedora this error is showing up on application log
Starting Apache Web Server...
Exit code: 8
Stdout:
apache config test fails, aborting
Stderr:
httpd: Syntax error on line 522 of /opt/lampp/etc/httpd.conf: Syntax error on line 10 of /opt/lampp/etc/extra/httpd-xampp.conf: Cannot load modules/libphp7.so into server: libnsl.so.1: cannot open shared object file: No such file or directory
can anyone tell me how can I solve this?
it seems you're missing libnsl. install it through this command:
sudo dnf install libnsl
In case this doesn't work you can then download it manually:
Visit https://pkgs.org/
In the search box (pkgs.org of course) type libnsl.so.1 and choose the appropriate OS. The version shown might be higher e.g libnsl-2.28-9.fc29.x86_64.rpm, but it doesn't matter, the file needed is also included in this very package.
In the terminal, navigate to the directory where the .rpm was downloaded.
Type the following command to install it:
sudo rpm libnsl-2.XX-X.fc29.x86_64.rpm
Upon completion everything should be working fine.
A quick Google search returns this: https://www.reddit.com/r/Fedora/comments/8hlhlv/xampp_with_fedora_28/
The suggested fix is installing libnsl from this source:
https://www.rpmfind.net/linux/rpm2html/search.php?query=libnsl.so.1%28%29%2864bit%29&submit=Search+...&system=fedora&arch=

QXcbConnection: XCB error: 145 (Unknown) Error message starting Spyder with MobaXTerm Qt5

I'm seeing the following error message when starting Spyder over a remote connection through MobaXTerm:
$ spyder
QXcbConnection: XCB error: 145 (Unknown), sequence: 171, resource id: 0, major code: 139 (Unknown), minor code: 20
Spyder still appears to work normally, but the error message pops up every time. A search on this error blames Qt5 and says there's no fix for X11 connections. I'm using Python 3.5.4, Spyder 3.2.3, and MobaXTerm Personal Edition v10.7 Build 3650 connecting to a system running RHEL 6.6.
How can I avoid the error message?
After trying the methods I could find on various websites:
conda install pyopengl on the base python installation
Adding both from OpenGL import GL and import ctypes; ctypes.CDLL("libGL.so.1", mode=ctypes.RTLD_GLOBAL) to site-packages/spyder/app/start.py
various Qt environment variable settings
EDIT:
I was finally able to stop the error messages by disabling only the "RANDR" MobaXTerm X11 extension:
Interestingly, the MobaXTerm documentation also has this extension disabled in the settings screenshots.
I ran into a similar issue when running rviz for ros2 from the Windows 10 WSL2 Ubuntu 20.10 Terminal with the command:
ros2 launch turtlebot3_bringup rviz2.launch.py
I tried unchecking the RANDR extension in MobaXterm to no effect. I was finally able to resolve the issue and launch rviz after issuing the following command:
export LIBGL_ALWAYS_INDIRECT=0
and then re-issuing the ros2 launch command above.

Raspberry Pi -fatal error: sys/cdefs.h: No such file or directory

I'm trying to compile gcc5.3.0 on my Raspberry Pi with latest Raspbian system image.
$ ./configure --enbale-checking=release --enable-languages=c,c++,fortran --host=arm-cortexa7_neon-linux-gnueabihf --build=arm-cortexa7_neon-linux-gnueabihf --target=arm-cortexa7_neon-linux-gnueabihf
$ make
However, the original compiler (gcc4.9) complains about not founding sys/cdefs.h when compiling libgcc.
I checked I have libc6-dev and build-essential installed.
So I used grep -R 'cdefs' /usr/include/ to search it and I found it at /usr/include/bsd/. I created the sys directory and made hard links to these headers under /usr/include/bsd/sys.
This time it gave me a more weird error,
/usr/include/stdio.h:312:8: error: unknown type name 'FILE'.
I searched this on stackoverflow, and there's a similar question, https://stackoverflow.com/a/21047237/5691005. But when I removed /usr/include/sys and /usr/include/bsd, then reinstalled libc6-dev, I cannot find sys/cdefs.h under /usr/include, and the compiler gave errors still.
I'm now totally lost. Any suggestion will be appreciated.
I had similar problem with compiling gcc-8.2. I tried to do as described here with reinstalling:
sudo apt-get --reinstall install libc6 libc6-dev
After that I was locating all missing headers:
find / -name cdefs.h
and copying them to /usr/include:
those steps allowed only to move forward but I still didn't manage to completely build gcc.
The best solution I found is to download compiled version of gcc-8.1 from:
https://solarianprogrammer.com/2017/12/07/raspberry-pi-raspbian-compiling-gcc/
I also ran into this problem when creating a containerized build environment for cross-compiled Qt applications for raspberry pi 4.
I found I needed to edit the mkspec for the linux-rasp-pi4-v3d device and add another cflag so that gcc could find the header from my Raspi sysroot that was used to cross-compile Qt.
Specifically under qtbase/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf:
QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8 -I$$[QT_SYSROOT]/usr/include/arm-linux-gnueabihf