Tuesday, April 15, 2025

Flash iso using terminal with mac

Probably not the "easy" way, because it's not graphical. But it is kinda pretty easy.

Open terminal (press cmd+space and type "terminal")

First type "diskutil list" and press enter (always without the inverted commas)

then insert your usb stick and run "diskutil list" again to see the disk node (e.g. /dev/disk2)

Now run "diskutil unmountDisk /dev/diskN" (where N is the number of the usb stick)

and then run "sudo dd if=/path-to.iso of=/dev/rdiskN bs=1m"

(after typing "sudo dd if=" you simply copy paste the path that's to be found when you right click on the file, then click "get info" and copy the path under "Where")

When finished "diskutil eject /dev/diskN"

Wednesday, February 21, 2024

Fix: VMWare workstation 17 shared folder between host windows and Linux VM

vmware-hgfs client shows up shared folder but nothing shown under /mnt/hgfs

run the following to fix this issue.
 

 sudo vmhgfs-fuse .host:/ /mnt/hgfs/ -o allow_other -o uid=1000

Wednesday, August 16, 2023

Fixed: failed to execute script pyinstaller-entry-point (ADE start)

Docker may not be installed on the machine,this can be an issue as ade is just a wrapper on the docker. you can use the following page https://docs.docker.com/engine/install/ubuntu/ for installation of docker or short instructions are as below.


Thursday, May 18, 2023

Replay udp data using tcpreply

tcpreplay is primarily designed for replaying packets at the network level and may not be suitable for replaying UDP packets. Thus bit of work is needed to replay this data. update the input.pcap to us your desired MAC id's

tcprewrite --enet-dmac=destinationMAC --enet-smac=sourceMAC -i input.pcap -o output.pcap
Replace destinationMAC with the MAC address of the destination machine or network interface you wish to send the UDP packets to. Replace sourceMAC with the MAC address of the network interface you plan to send the packets from. Now you would be able to replay this packets

sudo tcpreplay -i input.pcap -o output.pcap
test script to read this packets ( Python3 script is provided to read data on port 9999 )

import socket

UDP_IP = "0.0.0.0"
UDP_PORT = 9999

sock = socket.socket(socket.AF_INET, # Internet
                     socket.SOCK_DGRAM) # UDP
sock.bind((UDP_IP, UDP_PORT))

while True:
    data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
    print("received message: %s" % data)

Friday, May 20, 2022

Fix for HDMI to an external monitor:

Run the commands below with the HDMI connected to my monitor:

  • xrandr --listproviders (to make sure you have NVIDIA-G0 as a provider)
  • xrandr --setprovideroutputsource NVIDIA-G0 modesetting 
  • xrandr --auto


Ref: Found the info in the last post in this thread: https://www.linuxquestions.org/questions/debian-26/debian-11-bullseye-on-optimus-laptop-not-detecting-external-screen-4175690446/

Solution : how to check if the drive is ssd or hdd ?

Command :  lsblk -o NAME,ROTA

Result: 

NAME   ROTA
sda       0
└─sda1    0
sdb       1
├─sdb1    1
├─sdb2    1
├─sdb3    1
├─sdb4    1
nvmep1    1


 1 for hard drive and 0 for ssd.

Wednesday, January 5, 2022

Add the pem certificate to linux

Add the ca-certificate to access the site.

1# Extract pem files 2unzip cert-cas.zip 3cd cert-cas 4 5# convert all pem files to crt 6for f in *; do mv -- "$f" "${f%.pem}.crt"; done 7 8sudo mkdir /usr/local/share/ca-certificates/extra 9sudo cp *.crt /usr/local/share/ca-certificates/extra/root.cert.crt 10sudo update-ca-certificates

certificates will be available ( below shows confirmation )

1test@testM1:/usr/local/share/ca-certificates/extra$ sudo update-ca-certificates 2Updating certificates in /etc/ssl/certs... 3rehash: warning: skipping duplicate certificate in cert-cas.pem 43 added, 0 removed; done. 5Running hooks in /etc/ca-certificates/update.d... 6 7Adding debian:test.com-cachain.pem 8Adding debian:test.com-rootca.pem 9Adding debian:test.com-subca.pem 10done. 11done. 12

Find files in dir not contain a string



 find . -iname "*.md" -exec grep -Li "All rights reserved" {} \+

Thursday, November 11, 2021

Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException Unrecognized named-value: 'secrets'

 Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. /home/runner/work/test/test/./.github/actions/test/action.yml (Line: 22, Col: 14): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.PASS


Fix: actions does not have access to secrets, only the workflow is allowed to access secrets.


workflow to pass the secret as:

with:
  secret_input: ${{ secrets.SUPER_SECRET }}

And then, in action.yml,

inputs:
  secret_input: 
     description: "..."
     required: true
...

runs:
.....
  - name: .....
    env:
      MY_SECRET: ${{ inputs.secret_input }}

Friday, October 8, 2021

Use github action to checkout gitlab (or external submodules)



add the CI_USER and CI_PAT to your github repo under secrets.
replace gitlab with your external repo.

Thursday, September 16, 2021

"apt full-upgrade" returns "1 not fully installed or removed."

1. find the issue.
     sudo dpkg -C


test@test:/var/lib/dpkg$ sudo dpkg -C

The following packages are in a mess due to serious problems during

installation.  They must be reinstalled for them (and any packages

that depend on them) to function properly:

 libreoffice-common   office productivity suite -- arch-independent files

3. Remove the broken package via the following command:

    sudo dpkg --remove --force-remove-reinstreq  libreoffice-common  

4. Install the package again:

    sudo apt-get install  libreoffice-common  


Thursday, September 2, 2021

Wifi setup from command line on linux

 1. find the wireless interface (starting with w)


ip a


2. To check the configuration of the wireless interface


sudo iwconfig


2. make sure the wireless interface is up


sudo ip link set w___ up


3. find the ESSID of available for connection


sudo iwlist w___ scan | grep ESSID


4.1 Connect to the ESSID of your choice ( yyy )


sudo iwconfig w___ essid yyy


4.2 If it's password-protected then use


sudo iwconfig w___ essid yyy key s:zzz


(Here "s:" is used for string, while "zzz" is your key)


5. Setting up dhcp


sudo dhclient w___


6. check the connection to the internet


ping 8.8.8.8




Monday, August 2, 2021

recursively delete empty directories

delete all empty folders in current dir
find . -type d -empty -delete 
delete all empty files in current dir 
find . -type f -empty -delete 
print all empty folders in current dir 
find . -type d -empty -print

Friday, July 23, 2021

ade environment share directory from local machine or external drive

Add following to the .aderc ( lsblk can be used to find the mounted dir if it's a external usb drive or SSD )


  --mount type=bind,source=/media/sda1-usb-Generic_Flash_Di,destination=/media/sda1-usb-Generic_Flash_Di,bind-propagation=shared

Thursday, May 20, 2021

fix Font characters displayed as squares in Ubuntu

 




execute


rm -rf ~/.cache/fontconfig 
sudo fc-cache -r -v

enter your sudo password after executing this lines and  reboot

Wednesday, May 19, 2021

Setup ragner highlighting file

sudo apt install ranger highlight


to setup highlighting of file execute following 


 ranger --copy-config=scope




Tuesday, April 27, 2021

Fix Microsoft OneDrive export large ZIP files that are corrupt

File downloaded where size is more then 4GB, when you try unzipping shows corrupt.

Looks like there is a bug in the zip library itself that is not fixed. Following is a workaround.


problem:

 zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

Solution: (from Paul Marquess)


https://github.com/pmqs/Fix-OneDrive-Zip

fix-onedrive-zip onedrive-zip-test-zeros.zip

After running the script, You shall be able to unzip the file as normal without error.


Note:-

If you want to see detailed explanation then see following


https://www.bitsgalore.org/2020/03/11/does-microsoft-onedrive-export-large-ZIP-files-that-are-corrupt