Skip to main content

Posts

Showing posts from March, 2019

git setup

git config --global user.name "somename"  git config --global user.email "github-email"   if github email is private set the private email     git remote add origin https://github.com/username/myproject.git git remote -v git push --set-upstream origin master git add files/folders git commit -m 'message' git push

brightness debian

sudo nano /etc/udev/rules.d/backlight.rules ----------------------------------------------------------------------------------------------------------------------- ls /sys/class/backlight to fibd device_dir and set it apt get-install bc for timer -------------------------------------------------------------------------------------------------------------------- sudo nano ~/scripts/bright --------------------------------------------------------------------------------------------------------------------- #!/usr/bin/env bash set -e backlight_dir='/sys/class/backlight' device_dir='intel_backlight' device_dir="${backlight_dir}/${device_dir}" brightness_file="${device_dir}/brightness" curr_brightness=$(cat "${brightness_file}") max_brightness=$(cat "${device_dir}/max_brightness") if [ "$1" == 'current' ]; then echo $( echo "(${curr_brightness} / ${max_brightness}) * 50" | bc -l) \ | cut -d'.'

python string prefix

stringliteral ::= [ stringprefix ]( shortstring | longstring ) stringprefix ::= "r" | "u" | "R" | "U" | "f" | "F" | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF" shortstring ::= "'" shortstringitem * "'" | '"' shortstringitem * '"' longstring ::= "'''" longstringitem * "'''" | '"""' longstringitem * '"""' shortstringitem ::= shortstringchar | stringescapeseq longstringitem ::= longstringchar | stringescapeseq shortstringchar ::= longstringchar ::= stringescapeseq ::= "\" bytesliteral ::= bytesprefix ( shortbytes | longbytes ) bytesprefix ::= "b" | "B" | "br" | "Br" | "bR" |

minimal initramfs

sudo vim /etc/mkinitcpio.conf MODULES=(ahci sd_mod ext4) BINARIES=(fsck fsck.ext4) FILES=() HOOKS=(base) sudo mkinitcpio -g /boot/initramfs-linux-tiny.img reboot and press e and edit initrd initramfs-linux.img to initramfs-linux-tiny.img if system boots mkinitcpio -p linux src: https://wiki.archlinux.org/index.php/Minimal_initramfs http://blog.falconindy.com/articles/optmizing-bootup-with-mkinitcpio.html

void audio

#installing   extract void tarball example: https://alpha.de.repo.voidlinux.org/live/current/ void-x86_64-ROOTFS-20181111.tar.xz #cfdisk #mkfs.ext4 /dev/sdax #mount /dev/sdax /mn $ cd Downlaods #mv void-x86_64-ROOTFS-20181111.tar.xz /mnt #tar -xvpf  void-x86_64-ROOTFS-20181111.tar.xz #arch-chroot /mnt or https://wiki.voidlinux.org/Installation_on_UEFI,_via_chroot # mount -t proc proc /mnt/proc # mount -t sysfs sys /mnt/sys # mount -o bind /dev /mnt/dev # mount -t devpts pts /mnt/dev/pts # cp -L /etc/resolv.conf /mnt/etc/ # cd /mnt # chroot /mnt   # passwd root # chown root:root / # chmod 755 /    #blkid replace uuid here to ur own of /dev/sdax of root partition UUID=162ba999-40d6-4825-8011-49bbeba1143f / ext4 rw,noatime,discard 0 1 #vi /etc/default/libc-locales #uncomment needed locales en_US.UTF-8 UTF-8   #xbps-reconfigure -f glibc-locales   sudo xbps-install leafpad xbps-query xbacklight xwinfo xprop ranger polybar i3 xorg-minimal sxiv st firefox   s

hiragana japanese script

src: https://www.tofugu.com/japanese/hiragana-chart/#

rustup

  curl https://sh.rustup.rs -sSf | sh  or pacman -S rustup rustup install stable /  rustup install toolchain stable-x86_64-unknown-linux-gnu

The computer restarted unexpectedly error on restart after before completing setup

troubleshoot >command prompt >regedit KEY_LOCAL_MACHINE \SYSTEM : \system32\config\system HKEY_LOCAL_MACHINE \SAM : \system32\config\sam HKEY_LOCAL_MACHINE \SECURITY : \system32\config\security HKEY_LOCAL_MACHINE \SOFTWARE : \system32\config\software HKEY_USERS \UserProfile :  \winnt\profiles\username HKEY_USERS.DEFAULT : \system32\config\default import reg hive to edit (\system32\config\system\) or shift+f10 on error message to open terminal and open regedit    Once Registry Editor starts, navigate to the HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\ChildCompletion and double click the setup.exe in the right pane. setup.exe change its dword value from 1 to 2

windows 7/8/10 bootable from linux

user agent switcher https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg   switch user agent=linux/android   iso link    https://www.microsoft.com/en-in/software-download/windows10ISO   sudo woeusb --target-filesystem NTFS --device ~/Downloads/windows.iso /dev/sdx    

arch4edu repo

nano/vi /etc/pacman.conf   [arch4edu] SigLevel = Never Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch    view apps: https://mirrors.tuna.tsinghua.edu.cn/arch4edu/     src/bugs: https://github.com/arch4edu/arch4edu/wiki

debian unstable anbox test

sudo apt install anbox sudo modprobe ashmem_linux sudo modprobe binder_linux sudo service anbox-container-manager start anbox session-manager anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity ------------------- download android iamge  https://build.anbox.io/android-images move it to as /var/lib/anbox/android.img

dmenurecord

apt install dmenu i3 ffmpeg i3blocks touch ~/scripts/dmenurecord nano dmenurecord ------------------------------------------------------ #!/bin/sh # Usage: # `record`: Ask for recording type via dmenu # `record screencast`: Record both audio and screen # `record video`: Record only screen # `record audio`: Record only audio # `record kill`: Kill existing recording # # If there is already a running instance, user will be prompted to end it. updateicon() { \     echo "$1" > /tmp/recordingicon     pkill -RTMIN+9 i3blocks     } killrecording() {     recpid="$(cat /tmp/recordingpid)"     # kill with SIGTERM, allowing finishing touches.     kill -15 "$recpid"     rm -f /tmp/recordingpid     updateicon ""     pkill -RTMIN+9 i3blocks     # even after SIGTERM, ffmpeg may still run, so SIGKILL it.     sleep 3     kill -9 "$recpid"     exit     } screencast() { \     ffmpeg -y \     -f x11grab \     -framera

kali repo on debian

add kali repo to sources --------------------------------------------------------------------------------- sudo nano /etc/apt/sources.list deb http://http.kali.org/kali kali-rolling main non-free contrib --------------------------------------------------------------------------------- to see current repo priority apt-cache policy to adjust apt priority sudo nano  /etc/apt/preferences.d/kali-pin Package: * Pin:release o=kali Pin-Priority: 10