Skip to content

Instantly share code, notes, and snippets.

@sanrandry
sanrandry / note.md
Created Mar 8, 2022
add current git branch to a bash terminal
View note.md
@sanrandry
sanrandry / fix-ntfs-not-mounting.md
Created Feb 2, 2022
fix ntfs not monting linux dual boot windows
View fix-ntfs-not-mounting.md

Use ntfsfix

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

with sdaX is the device in NTFS

@sanrandry
sanrandry / note.md
Created Jan 8, 2022
Debian mico noise canceling pulse audion
View note.md

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
sanrandry / gitlab community edition installation ruby wait error.md
Created Nov 3, 2021
gitlab community edition installation ruby wait error
View gitlab community edition installation ruby wait error.md

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
sanrandry / caculate_navbar_height.md
Last active Jun 7, 2021
calculate navbar height
View caculate_navbar_height.md
  • add this javascript
document.documentElement.style.setProperty('--nav-height', document.getElementById("navbar").offsetHeight);
  • use property iny css
:root {
    --nav-height: 70px; /*You HAVE To Give A Default Fallback Value*/
}
@sanrandry
sanrandry / Disable wyland for skype or screen sharing error.md
Last active Mar 10, 2022
Disable wyland for skype or screen sharing error
View Disable wyland for skype or screen sharing error.md

Disable wyland for skype or screen sharing error

cd /etc/gdm3/
sudo vim daemon.conf

unocoment the line: WaylandEnable=false

@sanrandry
sanrandry / 5.py
Created Feb 2, 2021
python reminder
View 5.py
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
sanrandry / debian_amd_driver.md
Last active Jan 19, 2021
debian amd driver installation
View debian_amd_driver.md

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

xrandr

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

View install.md

unsinstall older version

sudo apt-get remove docker docker-engine docker.io containerd runc

set up the repository

update

View wordpress_custom_widget.md

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