bluetooth management

btmgmt

bluetooth control

bluetoothctl

MAC address of headphones

38:18:4C:17:DA:4E

list bluetooth adapters

hciconfig -a

or

bluetoothctl
list

intel based controllor that never works properly

80:32:53:71:12:03

Good controllor

5C:F3:70:9C:CA:D3

select a controllor

select 5C:F3:70:9C:CA:D3

how to connect - the actual solution to my problem

bluetoothctl
select 5C:F3:70:9C:CA:D3
connect 38:18:4C:17:DA:4E
Posted @ 2020-10-06 23:49

Making a wheel

python3 setup.py sdist bdist_wheel

Activate a venv:

source venv/bin/activate

Change ownership of a file

sudo chown a file_name

pytest class level fixtrues

@pytest.fixture(autouse=True)
def setup_method(self, monkeypatch):
    pass

An awesome python repr

https://bpython-interpreter.org/

Run chrome without CORs

google-chrome --disable-web-security --user-data-dir=/tmp

docker compose

docker-compose down && docker-compose up -d

Bluetooth

bluetoothctl
connect 38:18:4C:17:DA:4E WH-CH700N
connect 34:88:5D:CC:B8:AF Keyboard K380
connect C9:09:A1:92:5D:B1 MX Anywhere 2
Posted @ 2020-09-22 10:50

From the project directory:

python3.6 -m venv ./env

Activate it:

source env/bin/activate

Posted @ 2019-11-10 22:43

Reload sound driver in Ubuntu: pulseaudio -k && sudo alsa force-reload

I've needed to do this on multiple installs far, far too often.

Posted @ 2019-07-19 18:09

word = word.translate(str.maketrans('','',string.punctuation))

Posted @ 2019-03-10 15:51

make sure the service is started:

sudo service mongod start
Posted @ 2019-02-28 14:47

See ports in use:

sudo ss -plnt

Filter the list:

sudo ss -plnt | grep ':80'

Kill all proccess using a specific port, this will do so violently:

kill -9 $(lsof -t -i:5000)
Posted @ 2019-02-28 14:45

no ethernet networking

not helpful but good for info

lshw -C network

sudo service network-manager restart

modified

/etc/NetworkManager/NetworkManager.conf

changed managed to true

changed it back

still no internet

lspci -nn | grep 0200

00:19.0 Ethernet controller [0200]: Intel Corporation Ethernet Connection I217-V [8086:153b]

this did nothing

sudo apt-get install build-essential linux-headers-generic

installed net-tools for ifconfig, why doesn't it have it by default?

it seems like it has the driver, that the driver works but that it just doesn't connect

upgrading ubuntu software packages to see if it helps

this seems to be the driver and this command checks it?

sudo modprobe e1000e

grep of log for adapter

dmesg | grep e100

log says it was renamed:

[    0.943644] e1000e 0000:00:19.0 eno1: renamed from eth0

this might be the cause of the problem?

tried manually setting ip, netmask dns for ip4 for the adapter, tells me it's connected, guess what it's not connected

ethernet adapter is called eno1 for some reason

downloading driver from intel for

Ethernet controller: Intel Corporation Ethernet Connection I217-V

got the info on that from running

    lspci



sudo apt install ethtool

get info on adapter

ethtool adapter_name

e.g. ethtool eno1

I'm now somewhat convinced that this is a hardware problem that is possibly CPU related due to some other problems.

It is really intermittent though, in using Fedora the same computer has no problems with the network adapter. Like Ubuntu however the sound doesn't work for headphones which is a whole other annoying Gnome3 thing.

Posted @ 2019-02-28 13:07
while sleep 1; do ls | wc -l; done

rm -r *.srt

ls -alh | grep '\.json$' | sort

Search all files for a specific extension:
find / -name "*.pdf"
Posted @ 2019-02-28 13:05

Check the adapter state:

sudo lshw -C network

Make the network connection active:

sudo ifconfig eno1 up

Manually set the ipv4 setting for the ethernet adapter

sudo ifconfig eno1 192.168.0.15 netmask 255.255.255.0

Set the default gateway

sudo route add default gw 192.168.0.1 eno1

Set the defualt nameserver:

echo "nameserver 8.8.8.8" > /etc/resolv.conf

THE ABOVE IS BASICALLY ALL YOU NEED TO GET IT WORKING

i now get permission denied doing the above command even as root, permissions for the file resolv.conf are actually for anyone to be able to edit

lrwxrwxrwx   1 root root       39 Jul  1 23:03 resolv.conf -> ../run/systemd/resolve/stub-resolv.conf

so it's a little strange, looking at the file the nameserver is:

    nameserver 127.0.0.53

so i'm changing it to: 8.8.8.8

so trying to save resolv.conf i get:

    could not save file too many levels of symbolic links

    a@a-Z97-D3H:/etc$ ls -al | grep resolv.conf
    lrwxrwxrwx   1 root root       39 Jul  1 23:03 resolv.conf -> ../run/systemd/resolve/stub-resolv.conf


i have changed both files in: /run/systemd/resolve

to have a name server of: 8.8.8.8

These two are not that useful

lspci -nnk

lspci -nnk | grep -A2 net
Posted @ 2019-02-28 13:04

Command to fix problem with wifi dropping on x200

sudo iwconfig wlp3s0 power off
Posted @ 2019-02-28 13:02

get current driver info:

sudo lshw -c video

current driver:

configuration: driver=amdgpu latency=0

replace AMDs driver with MESA:

https://launchpad.net/~paulo-miguel-dias/+archive/ubuntu/pkppa

So folloing the advice in the above link i first purged and removed then did

sudo lshw -c video

and it's still using the same driver, so i don't think it's actually using the mesa driver at all

after re-adding the packages it still shows the driver as:

amdgpu

seems the right driver is installed you can check with:

glxinfo | grep "OpenGL version"

says mesa there

The mesa drivers are better but I am still getting graphical problems.

Posted @ 2019-02-28 13:01

Run as root:

docker stop $(docker ps -q)

Posted @ 2019-02-28 12:57

Use specific version of python:

mkvirtualenv -p /usr/bin/python3.6 env_name
Posted @ 2019-02-28 12:52

you can link to any wikipedia page by an id

https://en.wikipedia.org/?curid=23251407

random number in this range seems ok:

232562

https://en.wikipedia.org/?curid=232962

get random stuff (doesn't only return articles):

https://en.wikipedia.org/w/api.php?action=query&list=random&rnlimit=5

one random article (CHAR LIMIT exchars=500):

https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=extracts&exchars=500&format=json

specify an article type (otherwise you get all kinds of non-article things like templates and talks) THE ORDER OF THIS SEEMS TO MATTER

&grnnamespace=0


https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=1&prop=extracts&format=json

search for articles by a word (here the word is: meaning):

https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search%7Calllinks&iwurl=1&srsearch=meaning



/w/api.php?action=query&format=json&list=search%7Calllinks&iwurl=1&srsearch=meaning

Request json: { "action": "query", "format": "json", "list": "search|alllinks", "iwurl": 1, "srsearch": "meaning" }

CORs errors

Adding origin=* fixes CORs errors for requests from localhost for this API.

Posted @ 2019-02-28 12:49
  1. Use a proxy service which just exposes one key to that service - this is basically like 3

  2. call the API from the back end - i think that mashape is an API proxy? yahoo also run an API proxy where you can use third party proxies - I have found this to be a bit unreliable.

  3. if the API allows it you can tell it to only allow traffic from one domain - this actually seems like the most reasonable approach.

  4. Use env variables if you have a back end and access to the server.

Posted @ 2019-02-28 12:44

lsof -w -n -i tcp:5000

lsof -w -n -i tcp:5000

kill -9 processId

Posted @ 2019-01-30 18:10

Showing page 1 of 1