Skip to content

Instantly share code, notes, and snippets.

View arsho's full-sized avatar

Ahmedur Rahman Shovon arsho

View GitHub Profile
@arsho
arsho / fix_app_start_ubuntu_24.04.md
Created August 27, 2025 21:36
Fix App opening error in Ubuntu 24.04

Scenario

Apps like VLC, Libreoffice do not open from the dock and cannot open associated file extension that is mapped to the app (e.g. .mp3). FYI, the apps are installed from Ubuntu app center

Fix

  • Uninstall the apps from Ubuntu app center (e.g. VLC, libreoffice)
  • Install from terminal:
sudo apt install vlc -y

Here are some steps to try if you're getting an error mounting /dev/nvme0n1p6 in Ubuntu 23.10:

  • Open the Disks program
  • Select the disk that doesn't mount
  • Click the Gears icon or Additional Partition Options button
  • Select Edit Mount Options
  • Disable User Session Defaults
  • Click OK in the Mount Options dialog box
  • Repeat for each drive that gives an error message
@arsho
arsho / fix_cuda_12_2_ubuntu_23_10.md
Last active July 11, 2025 01:19
Install CUDA 12.0 or CUDA 11.4 in Ubuntu 23.04
  • Check versions of gcc, g++, and nvcc:
gcc --version
gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
g++ --version
g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0
nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Aug_15_22:02:13_PDT_2023
@arsho
arsho / baobab.md
Created October 19, 2022 22:11
Ubuntu disk usage analyzer, clear memory

Disk usage analyzer

  • Open a terminal and write:
baobab
  • It will open an window that shows disk usage.

References

@arsho
arsho / add_ssh_github.md
Created June 27, 2022 17:29
Add SSH key to Github from Ubuntu 22.04 LTS
@arsho
arsho / Solution.java
Created February 5, 2022 15:38
Basic BFS
class Solution {
// Function to return Breadth First Traversal of given graph.
public ArrayList < Integer > bfsOfGraph(int V, ArrayList < ArrayList < Integer >> adj) {
ArrayList < Integer > ans = new ArrayList < Integer > ();
int[] color = new int[V];
color[0] = 1;
Queue < Integer > q = new LinkedList < > ();
q.add(0);
ans.add(0);
while (q.size() != 0) {

Four numbers each from -1 to 1 that sum up to 1

You can use Python's combination with replacement method.

from itertools import combinations_with_replacement
import csv

def get_four_numbers(target_sum=100):
 result = []
#include <bits/stdc++.h>
using namespace std;
long merge_sorted_arrays(long ar[], long temp[], long left, long mid, long right) {
long inversion_count = 0;
long left_pos = left;
long right_pos = mid + 1;
long current_pos = left;
while (left_pos <= mid && right_pos <= right) {
if (ar[left_pos] <= ar[right_pos]) {
@arsho
arsho / fix_ethernet.md
Created January 18, 2021 18:10
Fixed unmanaged ethernet connection in Ubuntu 20.10

Scenario

  • In Ubuntu the Ethernet connection was shown as unmanaged wired connection.
  • This happened after using sudo pppoeconf to configure a pppoeconfiguration.

Solution

  • Open /etc/NetworkManager/NetworkManager.conf with sudo previlege:
sudo gedit /etc/NetworkManager/NetworkManager.conf
  • Change the line managed=false to managed=true
@arsho
arsho / dell_logo_freeze_ubuntu.md
Created January 10, 2021 05:21
Solution to Ubuntu 20.04 LTS Dell logo freeze screen

Solution to: Stuck on Dell logo in Dual Boot Dell Machine

Machine Information:

  • Model: Dell G5 5587
  • Processor: Intel core i7-8750H
  • Ram: 16GB
  • Graphics: NVIDIA 1060 GeForce GTX 1060 Mobile
  • SSD: 256GB
  • HDD: 1TB