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 emailgit remote add origin https://github.com/username/myproject.gitgit remote -vgit push --set-upstream origin master git add files/foldersgit commit -m 'message'git push

reverse engineering windows tool

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'.' -f 1
else
directi…

kali mirrot

http://http.kali.org/README.mirrorlist

deb http://mirrors.tuna.tsinghua.edu.cn/kali/ kali-rolliing contrib non-free

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 | stringescapeseqlongstringitem ::= longstringchar | stringescapeseqshortstringchar ::= longstringchar ::= stringescapeseq ::= "\" bytesliteral ::= bytesprefix(shortbytes | longbytes) bytesprefix ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb&…

debian install chroot

pacman -S debootstrap

using gparted create ext4 partition (sdaX)

mount /dev/sdaX /mnt
debootstrap stable /mnt http://deb.debian.org/debian/arch-chroot /mntsource /etc/profilehttps://debgen.simplylinux.ch/to find sources.list urlsnano /etc/apt/sources.listdeb http://deb.debian.org/debian stable main non-free deb http://deb.debian.org/debian/ stable-updates main contrib non-free deb http://deb.debian.org/debian-security stable/updates main apt updateapt upgradeapt search linux-image apt install firmware-realtek sudo neofetch debsecan wpasupplicant linux-image-amd64

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


install qt

sudo pacman -S --noconfirm --needed qt5

src
https://github.com/therecipe/qt/wiki/Installation-on-Linux

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 / #blkidreplace 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 localesen_US.UTF-8 UTF-8#xbps-reconfigure -f glibc-localessudo xbps-install leafpadxbps-query xbacklight xwinfo xprop ranger polybar i3 xorg-minimal sxiv st firefoxsudo vi /etc/dhcpcd.conf #using cloudflare dns use 8…

hiragana japanese script

Image

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 switcherhttps://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg switch user agent=linux/androidiso link  https://www.microsoft.com/en-in/software-download/windows10ISOsudo 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

git

$ git config --global user.name "John Doe"
 $ git config --global user.email [email protected]

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 \
    -framerate 60 \
    -s $(xdpyinfo | grep di…

nvidia gpu accl kali

[email protected]:~$ sudo apt install nvidia-opencl-icd
apt install-y ocl-icd-libopencl1 nvidia-driver nvidia-cuda-toolkit

hashcat -I

run php from folder

$ php -S 127.0.0.1:1234 -t Documents/php/
--
php -S ip:port -t folder

kali slow update fix

change http to https
deb https://http.kali.org/kali kali-rolling main non-free contrib

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