## No HDMI no image. Need to be able to start without HDMI and if HDMI inserted show the same i was working on in VNC

I have Lubuntu 18.04 on an EB1501P MiniPC and i usually have HDMI plugged into a TV.

Sometimes i need something else connected to the TV and swap out the HDMI. Leaving Lubuntu without a HDMI output.

That in itself does no harm. But if i reboot without HDMI in it i have no picture on VNC and my user do not AutoLogin to Lubuntu beacasue of missing display.

Computer = EB1501P 64bit

GPU = NVIDIA ION

OS = Lubuntu LTS 18.04.3 64bit

I have tried to make a add to xorg.conf –allow-empty-initial-configuration and add a Virtual Desktop

nano /etc/X11/xorg.conf  Section "Device"    Identifier     "Device0"    Driver         "nvidia"    VendorName     "NVIDIA Corporation"    BoardName      "ION"    Option      "UseEDIDDpi"         "false"    Option      "DPI"                "96 x 96"    Option "AllowEmptyInitialConfiguration" EndSection  Section "Screen"    Identifier     "Screen0"    Device         "Device0"    Monitor        "Monitor0"    DefaultDepth    24    Option         "Stereo" "0"    Option         "metamodes" "1920x1080_60 +0+0"    Option         "SLI" "Off"    Option         "MultiGPU" "Off"    Option         "BaseMosaic" "off"    Option         "UseEdidDpi" "False"    SubSection     "Display"       Depth       24       Virtual     1920 1080    EndSubSection EndSection

And The Screen can show a picture with no HDMI plugged in. But when i plug in HDMI in TV i get black screen saying “No Signal”

Then i have allso tried installing and configuring

xserver-xorg-video-dummy-hwe-18.04

nano /etc/X11/xorg.conf  Section "Device"     Identifier  "Configured Video Device"     Driver      "dummy"     #Option "NoDDC" "true"     #Option "IgnoreEDID" "true" EndSection  Section "Monitor"     Identifier  "Configured Monitor"     HorizSync 31.5-48.5     VertRefresh 50-70 EndSection  Section "Screen"     Identifier  "screen0"     Monitor     "Monitor0"     Device      "Configured Video Device"     DefaultDepth 24     SubSection "Display"         Depth 24         Modes "1920x1080"     EndSubSection EndSection

And the Screen only shows picture om TV.

I have of course messed with many different attempts with these two configurations but for no avail. Sometimes it would show picture without HDMI in VNC but wouldten work on TV if plugged in. Other times i either could only acces TV or VNC image.

this is my origional xorg.conf created by nvidia-xconfig

# nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings:  version 390.77  (buildd@lcy01-amd64-022)  Thu Sep  6 07:51:39 UTC 2018  Section "ServerLayout"     Identifier     "Layout0"     Screen      0  "Screen0" 0 0     InputDevice    "Keyboard0" "CoreKeyboard"     InputDevice    "Mouse0" "CorePointer"     Option         "Xinerama" "0" EndSection  Section "Files" EndSection  Section "Module"     Load           "dbe"     Load           "extmod"     Load           "type1"     Load           "freetype"     Load           "glx" EndSection  Section "InputDevice"     # generated from default     Identifier     "Mouse0"     Driver         "mouse"     Option         "Protocol" "auto"     Option         "Device" "/dev/psaux"     Option         "Emulate3Buttons" "no"     Option         "ZAxisMapping" "4 5" EndSection  Section "InputDevice"     # generated from default     Identifier     "Keyboard0"     Driver         "kbd" EndSection  Section "Monitor"     # HorizSync source: edid, VertRefresh source: edid     Identifier     "Monitor0"     VendorName     "Unknown"     ModelName      "SAMSUNG"     HorizSync       26.0 - 81.0     VertRefresh     24.0 - 75.0     Option         "DPMS"     Option         "DPI" "96 x 96" EndSection  Section "Device"     Identifier     "Device0"     Driver         "nvidia"     VendorName     "NVIDIA Corporation"     BoardName      "ION"     Option      "UseEDIDDpi"         "false"     Option      "DPI"                "96 x 96" EndSection  Section "Screen"     Identifier     "Screen0"     Device         "Device0"     Monitor        "Monitor0"     DefaultDepth    24     Option         "Stereo" "0"     Option         "metamodes" "nvidia-auto-select +0+0 {AllowGSYNC=Off}"     Option         "SLI" "Off"     Option         "MultiGPU" "Off"     Option         "BaseMosaic" "off"     Option         "UseEdidDpi" "False"     SubSection     "Display"         Depth       24     EndSubSection EndSection

What do i need to do to be able to VNC into Lubuntu without out HDMI. And to use the same image on my TV if i suddenly plugin the Cable ?

Best regards and ty for reading Darkyere

## Ubuntu remembers every drive ever connected and every dvd ever inserted and PCmanFM shows it in folder panel

I am using PCManFM 1.2.5 as file manager on Ubuntu 18.04.2. When I go to my media folder, there I find listed the names of every external drive I ever connected and every disk I ever inserted in my dvd drive and even for my WLAN stick a separate entry for every time I connected it to the computer. How can I get Ubuntu to empty this list daily or forget about the devices as soon as they get disconnected?

## Can insertMultiple method return all inserted auto-increment ids?

I have to insert rows in two custom tables (which have a many-to-many relation).

I want to use batch insert (i.e. insertMultiple method in Magento 2) for the parent and child table both.

The issue is that if I will do batch insert in the parent table using an insertMultiple method, will it return all inserted ids to be used in the child (relation) table?

Please suggest any feasible and reliable solution.

## what are the tables being inserted when import product in Magento2?

I want to know what are the tables being inserted while import product in magento2.

or what are the main table to be inserted for showing products in home page( don’t think big. just to display in UI)

I have 1 Million of data, and I can’t upload a file which is more than 2mb.

It is not possible to split my file and insert.

I can create insert into ... query from csv file if I know the table names and its relations.

## Finding rank of newly inserted node in AVL tree augmented with rank of node

My prof was talking about how to augment a tree to efficiently find the key with a given rank. On the way to getting the right answer (store the size of the subtree rooted at each node), he proposed augmenting each node with it’s rank. That way finding the node with a certain rank is a simple binary search. But he said this wouldn’t work because insertion would be $$\Theta(n)$$. I understand that this is because in the worst case the newly inserted node has rank 0 and so the rank of each node in the tree must be incremented by 1. What I am interested in knowing is an algorithm for computing the rank of a newly inserted node. At first I thought that if a node $$n$$ is inserted to the left of a leaf $$l$$ with rank $$k$$ then the rank of $$n$$ is $$k-1$$, or $$k+1$$ if inserted right of $$l$$. I found a counter example to that so I know it is not the case. So how would this be done?

## Update sales order immediately after inserted

I want to update the sales order right after it is inserted.

I want to reflect the change on the sales order conformation email also which is going to the customer.

So i have prepared the below code and inserted into \Magento\Sales\Model\Order\Email\Sender::checkAndSend

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();$  resource = $objectManager->get('Magento\Framework\App\ResourceConnection');$  connection = $resource->getConnection();$  sqlx = "SELECT * FROM sales_order ORDER BY entity_id DESC LIMIT 1";     $connection->query($  sqlx);     $resultx =$  connection->fetchAll($sqlx); foreach($  resultx as $resulx) {$  entityid  = $resulx['entity_id']; }$  sql = "SELECT * FROM sales_order_item WHERE order_id='$entityid'";$  connection->query($sql);$  results = $connection->fetchAll($  sql);     foreach($results as$  result)     {         $item_id =$  result['item_id'];         $fullopt =$  result['product_options'];         $needle = 'Shoe Size'; if (strpos($  fullopt, $needle) !== false){$  pieces = explode('Shoe Size","value":"', $fullopt);$  sizenum = explode('","option_id', $pieces[1]); if(strpos($  fullopt, '"value":"EU"') !== false) {                 $rsizenum1 =$  sizenum[0]+31;                 $finalque =$  pieces[0].'Shoe Size","value":"'.$rsizenum1.'","option_id'.$  sizenum[1];             }             else if(strpos($fullopt, '"value":"UK"') !== false) {$  rsizenum2 = $sizenum[0]-1;$  finalque = $pieces[0].'Shoe Size","value":"'.$  rsizenum2.'","option_id'.$sizenum[1]; } else{$  finalque = $fullopt; }$  upsql = "UPDATE sales_order_item SET product_options='$finalque' WHERE item_id='$  item_id'";             $connection->query($  upsql);         }     }

The issue is that this dosent update the sales order emal which is goingout and also every time my order gets updated this is running again.

I only want this to run one time after order is inserted.

Anyone can give me a clue?

## Want to refactor working methods that return id of inserted row of query for country, city, and address tables

These are the 3 methods and I am just wondering what would be the right way to remove all the duplication? I want to use this example to learn how to do it to clean up the rest of my code. Please note that I am not allowed to use any external libraries or frameworks for this project outside of the standard java libraries. Thank you.

## Min Cut Algorithm using Randomly inserted directions

I had a question about a different randomized min cut algorithm (I don’t think it is as efficient as Karger’s algorithm for larger sizes of min cuts but it is more efficient for smaller ones).

My idea for an algorithm was that given some graph, I would randomly assign directions to its edges (i.e. flip a coin and if tails assign an edge to the vertex and if it’s away, assign an edge from the vertex) (O(n) time). Then run Kosaraju’s algorithm (O(n) time) to find all the strongly connected components. Then, we count the number of edges that are connected to each strongly connected component to find the size of the min cut. We return the smallest number and then run the algorithm more times as we do with randomized algorithms.

The intuition behind this algorithm is that I want to find different partitions of the vertices of the graph and I can do this by finding different strongly connected components if I assign directions to the graph. The only partition I cannot create is that of vertices that do not share an edge. However, there is no need to have two such vertices to be in a partition together because we can just take one or the other and have a smaller min cut.

I need help with analyzing the success rate. In a successful run of this algorithm, all of the vertices in the smaller partition of the min cut form a cycle. If the partition contains $$m$$ vertices and $$j$$ edges. Then I think the probability that it is successful is $$\binom{j}{m}\frac{1}{2^{m-1}}$$, since we choose $$m$$ of the edges to form a cycle and set them to form the cycle, but I am not really sure. If $$k$$ is the size of the min cut, we also need to make sure that the min cut does not point to something else, so that is another $$\frac{1}{2^k}$$ probability. I am not completely sure about this either, because it is very dependent on the structure of the graph and I am not sure if I am analyzing this correctly.

Any help/pointers/guidance would be appreciated. Thank you!

## echo command works when manually executed but not when inserted as bash script

I’m using Ubuntu 19.04 and I have sound crackling over HDMI using AMD RX460 connected to my LG LED TV.

This probably has something to do with AMD GPU driver because I have the exact same problem on Windows 10 pro. On windows I have used AMD Adrenaline GUI to fix the problem by not letting the GPU go into p-State 0 (214 MHz, 0.8v). There I set the p-State 1 as minimum state and modified the frequency and voltage to match the p-State 0 ones. Probably p-State 0 apply some other power saving setting which is why setting the same frequency and voltage for p-state 1 does produce the same crackling in sound.

Now I’m trying to do the same thing on Ubuntu 19.04 but with amdgpu driver. I have created to files hdmi-audio-crack-fix and hdmi-audio-crack-fix.service as follow:

1- Placed hdmi-audio-crack-fix inside /usr/bin with proper permissions.

#!/bin/bash # This simple script disables pstate 0 for amdgpu to fix audio crackling over hdmi. # Then pstate 1 is modified to match pstate 0 voltage and frequency. # Also a little bit of undervolting is introduced. # Copy to /usr/bin/ and then copy .service file to /etc/systemd/system/  # Using Ubuntu echo located inside /bin instead of bash built-in echo amdgpu_echo="/bin/echo"  # Change amdgpu dpm performance level to manual $amdgpu_echo "manual" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/power_dpm_force_performance_level # Disable pstate 0 as this is causing the crackling over hdmi$  amdgpu_echo "1 2 3 4 5 6 7" >  /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_dpm_sclk $amdgpu_echo "1 2 3 4 5 6 7" > /sys/class/drm/card0/device/pp_dpm_sclk # Now reduce pstate 1 clock to reduce temperature on idle$  amdgpu_echo "s 1 220 800" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_od_clk_voltage  # Undervolting gpu for highest pstates $amdgpu_echo "s 5 1138 992" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_od_clk_voltage$  amdgpu_echo "s 6 1172 1005" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_od_clk_voltage $amdgpu_echo "s 7 1212 1050" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_od_clk_voltage # Now sync new core/voltage table with GPU$  amdgpu_echo 'c' > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_od_clk_voltage

2- Placed hdmi-audio-crack-fix.service inside /etc/systemd/system/ and executed sudo systemctl enable hdmi-audio-crack-fix.service.

[Unit] Description=Temporarly fix for amdgpu HDMI audio crackling  [Service] Type=oneshot ExecStart=/usr/bin/hdmi-audio-crack-fix  [Install] WantedBy=multi-user.target

Everything works as expected but the following line doesn’t seem to have any effects and the GPU still goes to p-State 0:

$amdgpu_echo "1 2 3 4 5 6 7" > /sys/devices/pci0000:64/0000:64:00.0/0000:65:00.0/pp_dpm_sclk or$  amdgpu_echo "1 2 3 4 5 6 7" >  /sys/class/drm/card0/device/pp_dpm_sclk

The problem is when I execute this command manually through terminal using the following command it works properly:

sudo su - echo "1 2 3 4 5 6 7" >  /sys/class/drm/card0/device/pp_dpm_sclk

## cdc-acm driver cannot be inserted

i ve been trying to configure the proxmark3 easy for my linux box. as i insert the the pm3 in the usb port it is supposed to show a “CDC-ACM” when i type the dmesg command..this does not happen ..so i installed a cdc acm module from git hub but when i try to run the install.sh it says “unable to insert the module” i think this is because the module is for an older version of kali linux kernel and i am running kali linux 4.19.0 kernel..it would be great if someone could link a resource for the required module.

i tried to use the pm3 for my windows box which also does not detect the proxmark 3 when i insert it…PLZ I REALLY NEED HELP!!!!!!