Skip to content

Instantly share code, notes, and snippets.

sanrandry /
Created Mar 8, 2022
add current git branch to a bash terminal
sanrandry /
Created Feb 2, 2022
fix ntfs not monting linux dual boot windows

Use ntfsfix

  • list disk
    sudo fdisk -l
  • user ntfsfix command
sudo ntfsfix /dev/sdaX

with sdaX is the device in NTFS

sanrandry /
Created Jan 8, 2022
Debian mico noise canceling pulse audion

Add this line to /etc/pulse/etc/pulse

load-module module-echo-cancel source_name=noechosource sink_name=noechosink set-default-source noechosource set-default-sink noechosink

restart pulse audio

pulseaudio -k
sanrandry / gitlab community edition installation ruby wait
Created Nov 3, 2021
gitlab community edition installation ruby wait error
View gitlab community edition installation ruby wait

if you have this error

 * link[/opt/gitlab/service/redis] action create
  - create symlink at /opt/gitlab/service/redis to /opt/gitlab/sv/redis
 * ruby_block[wait for redis service socket] action run

execute this command on the server in another terminal

systemctl start gitlab-runsvdir.service
sanrandry /
Last active Jun 7, 2021
calculate navbar height
  • add this javascript'--nav-height', document.getElementById("navbar").offsetHeight);
  • use property iny css
:root {
    --nav-height: 70px; /*You HAVE To Give A Default Fallback Value*/
sanrandry / Disable wyland for skype or screen sharing
Last active Mar 10, 2022
Disable wyland for skype or screen sharing error
View Disable wyland for skype or screen sharing

Disable wyland for skype or screen sharing error

cd /etc/gdm3/
sudo vim daemon.conf

unocoment the line: WaylandEnable=false

sanrandry /
Created Feb 2, 2021
python reminder
from time import time, sleep
import subprocess
while True:
bashCommand = "zenity --notification --text='5'"
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
sleep(60 * 5)
sanrandry /
Last active Jan 19, 2021
debian amd driver installation

lspci -nnk | grep -i -EA3 "3d|display|vga"


sudo apt-get update sudo apt-get dist-upgrade

sudo apt-get install xserver-xorg-video-ati sudo apt-get install xserver-xorg-video-amdgpu


unsinstall older version

sudo apt-get remove docker docker-engine containerd runc

set up the repository



create wordpress custom widget

add this code to you function.php file

create the custom widget class

frist create a custom widget class that extend the default wordpress widget class this code is from the official wordpress code reference

class My_Widget extends WP_Widget {

	 * Sets up the widgets name etc