Skip to main content

Posts

Showing posts from June, 2021

win 10 alternative install

 boot into recoverymode via installation_media/settings shift+f10 to open terminal    get available windows editions:: dism /get-wiminfo /wimfile:D:\sources\install.wim  apply image:: dism /apply-image /imagefile D:\sources\install.wim /index:1 ##on preexisting win10 got errors:: rd "c:\programfiles\windowsapps" /s  ## or format disk   add boot entry  C:\windows\system32\bcdboot  C:\windows    ## error fix :: diskpart  select disk 0 select partition 1 ## select uefi part assign [optonal drive letter /path] bcdboot c:\windows /s z: /f UEFI  

metasploit database setup for archlinux

1. Switch to postgres user su root su postgres    or  sudo -iu postgres 2. Initialize database cluster initdb -D '/var/lib/postgres/data' exit systemctl start postgresql    3. Create database user     su root     su postgres     createuser msf -P     createdb --owner=msf msf     exit  ##remember password in this step u need to connect msf database 4. Database config for metasploit mkdir ~/.msf4 ##cd /opt/metasploit/config/##skip ##cp database.yml.example ~/.msf4/database.yml##skip sudo vim database.yml ---------------------------------------------------------------------------------' # To set up a metasploit database, follow the directions hosted at: # http://r-7.co/MSF-DEV#set-up-postgresql # # Kali Linux and the Omnibus installers both include an easy wrapper script for # managing your database, which may be more convenient than rolling your own. development: &pgsql   adapter: postgresql   database: msf   username: msf   password: #passwordsetin #3   host: localhost  

kde maximize window no title

  Edit the file ~/.config/kwinrc to add the line: BorderlessMaximizedWindows = true    or under the [Windows] section, so that it looks something like this: [ Windows ]   BorderlessMaximizedWindows = true       kwin -- replace   or    kwin_x11 -- replace kwin_wayland -- replace      

nvim config bak

 set number call plug#begin('~/.vim/plugged') Plug 'dracula/vim' Plug 'scrooloose/nerdtree' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'ryanoasis/vim-devicons' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'neoclide/coc.nvim', {'branch': 'release'} let g:coc_global_extensions = ['coc-emmet', 'coc-css', 'coc-html', 'coc-json', 'coc-prettier', 'coc-tsserver'] call plug#end()  if (has("termguicolors"))      set termguicolors  endif  syntax enable  colorscheme dracula    let g:NERDTreeShowHidden = 1  let g:NERDTreeMinimalUI = 1  let g:NERDTreeIgnore = []  let g:NERDTreeStatusline = ''  let g:NERDTreeGitStatusIndicatorMapCustom = {                     \ 'Modified'  :'✹',                 \ 'Staged'    :'✚',                 \ 'Untracked&

i3-msg syntax

 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps' --------------------------------------------------- move::  'window', 'container', 'to', '--no-auto-back-and-forth', 'workspace', 'output', 'mark', 'scratchpad', 'left', 'right', 'up', 'down', 'position', 'absolute' exec::  '--no-startup-id', <string> exit:: close i3 restart:: restart i3 reload:: reload config file shmlog:: string=log size debuglo

polybar menu guide

it use like arrays :: ' ; If true, <label-toggle> will be to the left of the menu items (default). ; If false, it will be on the right of all the items "menu-LEVEL-N" has the same properties as "label-NAME" with ; the additional "exec" property ; Commands will be executed using "/bin/sh -c $COMMAND" ; Available tags: ; <label-toggle> (default) - gets replaced with <label-(open|close)> ; <menu> (default) ; If expand-right is true, the default will be "<label-toggle><menu>" and the ; other way around otherwise. ; Note that if you use <label-toggle> you must also include ; the definition for <label-open> ; format = <label-toggle><menu>     first menu starts with 0 ::    [module/menxx] type = custom/menu expand-right = true label-open =shortcut label-close = close --------------------------------------------------------------- syntax menu-LEVEL-N #defin

rofi-bluetooth control

dependencies sudo pacman -S rofi bluez-utils sudo systemctl enable bluetooth  https://raw.githubusercontent.com/nickclyde/rofi-bluetooth/master/rofi-bluetooth   polybar config [module/bluetooth] type = custom/script exec = rofi-bluetooth --status interval = 1 click-left = rofi-bluetooth &    i3 config bindsym $mod+b exec --no-startup-id rofi-bluetooth        

windows copy file on same vs diff partition

 et's compare to the two operations. First, copying a file from one partition to another: The source is opened. The destination is opened/created. Space is allocated for the destination. Every byte of file data is read from the source and written to the destination. The destination file is closed. The source file handle is set to unlink on close. The source file handle is closed, unlinking the file. Since that is (typically) the last reference to the source file data, the source file data has to be made free. Now, copying a file from one folder to another on the same partition. The source is opened. A new hard link is created to the source file in the destination directory. The handle to the source file is set to unlink on close. The source handle is closed, unlinking it. The source file is still linked to the destination directory, so no free space needs to be changed.   https://superuser.com/questions/424650/why-copying-files-in-one-partition-is-much-faster-than-copying-fi

pactl

 pactl list sinks short | cut -f2 pactl list sources short | cut -f2 pactl list | grep -A2 'Source #' | grep 'Name: .*\.monitor$' | cut -d" " -f2

neovim setup for c/c++/python/bash

sudo pacman -S nvim  https://github.com/junegunn/vim-plug sh -c ' curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim '   for vim/  curl -fLo ~ /.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim    mkdir ~/.config/nvim vim  ~/.config/nvim/init.vim      call plug#begin ( ' ~/.vim/plugged ' )    "plugin section add Plug '*/*'   call plug#end ()  "config section    ##theme Plug 'dracula/vim' config section   if (has("termguicolors")) set termguicolors endif syntax enable colorscheme dracula $ nvim +PlugInstall     # # file browser ##use control+b to toggle nerdtree Plug 'scrooloose/nerdtree' Plug 'ryanoasis/vim-devicons'   let g : NERDTreeShowHidden = 1

headphone/earphone switch script

 bindsym $mod1+slash exec  pactl set-sink-port alsa_output.pci-0000_00_1f.3.pro-output-0  analog-output-headphones bindsym $mod1+shift+slash exec  pactl set-sink-port alsa_output.pci-0000_00_1f.3.pro-output-0  analog-output-speaker  pactl list sinks short 48      alsa_output.pci-0000_00_1f.3.pro-output-0       PipeWire        s32le 2ch 48000Hz       RUNNING 69      alsa_output.pci-0000_00_1f.3.pro-output-3       PipeWire        s32le 8ch 48000Hz       SUSPENDED 46      alsa_output.pci-0000_00_1f.3.pro-output-7       PipeWire        s32le 8ch 48000Hz       SUSPENDED 68      alsa_output.pci-0000_00_1f.3.pro-output-8       PipeWire        s32le 8ch 48000Hz       SUSPENDED 59      alsa_output.pci-0000_00_1f.3.pro-output-9       PipeWire        s32le 8ch 48000Hz       SUSPENDED 43      alsa_output.pci-0000_00_1f.3.pro-output-10      PipeWire        s32le 8ch 48000Hz       SUSPENDED 67      alsa_output.pci-0000_00_1f.3.pro-output-11      PipeWire        s32le 8ch 48000Hz       SUSPENDED 77  

alpine test (finally success on real hw)

 https://alpinelinux.org/downloads/  download minirootfs at this time current was: https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/x86_64/ cd Downloads sudo tar xvf alpine-minirootfs-3.13.5-x86_64.tar.gz -C /mnt   cp /etc/resolv.conf /mnt/etc/resolv.conf    sudo arch-chroot /mnt /bin/ash -l apk update apk upgrade apk add alpine-base nano now u can follow https://wiki.alpinelinux.org/wiki/Installation  https://wiki.alpinelinux.org/wiki/Alpine_Linux_in_a_chroot  https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts  setup-alpine  install to hdd sucess by using iso  make ext4 fs and mount to /mnt setup-alpine /mnt setup_xorg apk install dwm dmenu st sudo/doas adduser kai chgrp wheel kai              

iwd wifi control arch

iwd aims to replace wpa_supplicant in future and heavily uses kernel features sudo pacman -S iwd sudo systemctl enable iwd sudo systemctl enable systemd-resolved  sudo systemctl start systemd-resolved sudo systemctl start iwd iwctl [iwd] help device list station device scan station device get-networks station device connect SSID   enable built in dhcp /etc/iwd/main.conf [General] EnableNetworkConfiguration=true    src:: https://wiki.archlinux.org/title/Iwd

wpa_supplicant

  wpa_passphrase <MYSSID> <passphrase> >> ~/config/wpa_s upplicant/config  config file will be generated  get interface name by ip link here mine is wlp1s0  sudo wpa_supplicant -B -i wlp1s0 -c ~/.config/wpa_supplicant/config  to allow running wpa_cli   nano/vim ~/config/wpa_s upplicant/config ctrl_interface=/run/wpa_supplicant ctrl_interface_group=wheel update_config=1 ap_scan=1     sudo dhcpcd wlp1s0   src:: https://wiki.archlinux.org/title/Wpa_supplicant    

askpass for sudo via rofi in i3

 nano  $HOME/.local/bindmenupass ------------------------------------------- #!/bin/sh # This script is the SUDO_ASKPASS variable, meaning that it will be used as a # password prompt if needed. rofi -dmenu \     -password \     -no-fixed-num-lines \     -p "$(printf "$1" | sed s/://)" ------------------------------------------- nano $HOME/.bashrc PATH="$HOME/.local/bin:$PATH" export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"      ------------------------------------------ using dmenu dmenu -p "$1" <&- && echo -P if u have password patch    

void install

 https://voidlinux.org/download/ https://alpha.de.repo.voidlinux.org/live/current/void-x86_64-musl-ROOTFS-20210218.tar.xz\ mkfs.ext4 /dev/sdxx mount /dev/sdxx  /mnt tar xvf void-<...>-ROOTFS.tar.xz -C /mnt       # mount --rbind /sys /mnt/sys && mount --make-rslave /mnt/sys # mount --rbind /dev /mnt/dev && mount --make-rslave /mnt/dev # mount --rbind /proc /mnt/proc && mount --make-rslave /mnt/proc    # cp /etc/resolv.conf /mnt/etc/   # PS1='(chroot)'  # chroot /mnt/ /bin/bash      or from archlinux arch-chrrot /mnt # xbps-install -Su xbps # xbps-install -u # xbps-install base-minimal # xbps-remove base-voidstrap   base-system https://github.com/void-linux/void-packages/blob/master/srcpkgs/base-system/template base-files>=0.77 ncurses coreutils findutils diffutils libgcc   dash bash grep gzip file sed gawk less util-linux which tar man-pages   mdocml>=1.13.3 shadow e2fsprogs btrfs-progs xfsprogs f2fs-tools dosfstools  procps-ng tzdata

gpg setup

  addgnupghome user1 gpg --full-gen-key gpg --list-key key id is last 8 alphabets of public key  my key id is 041CBEC7 gpg --list-secret-keys gpg --export --armor --output public.key user-id   gpg --import public.key gpg --send-keys key-id     my key is in  http://hkps.pool.sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&search=0x10DD9A2F041CBEC7        gpg --search-keys user-id      

shotgun screenshot in i3

 sudo pacman -S hacksaw shotgun https://github.com/neXromancers/shotgun hacksaw for window selection shotgun for full screenshot bindsym $mod+Print exec shotgun -f png ~/Pictures/screenshots/$(date +%s).png   bindsym Print exec shotgun $(hacksaw -f "-i %i -g %g") -f png ~/Pictures/screenshots/$(date +%s).png

playerctl cmds

 bindsym $mod+comma exec  playerctl previous bindsym $mod+period exec playerctl next bindsym XF86AudioPause exec playerctl play-pause            bindsym $mod+Shift+period exec playerctl position 10+ #seeks 10s fwd bindsym $mod+Shift+comma exec playerctl position 10-   #seek 10s back keys .Xmodmap keycode 133 = Mode_switch keycode 24 = q Q q Q keycode 25 = w W w W keycode 26 = e E Up Up keycode 27 = r R r R keycode 28 = t T t T keycode 29 = y Y y Y keycode 30 = u U u U keycode 31 = i I i I keycode 32 = o O o O keycode 33 = p P p P keycode 38 = a A a A keycode 39 = s S Left Left keycode 40 = d D Down Down keycode 41 = f F Right

accesibility gtk dbus disable

Set environment variable in .xprofile or .xinitrc (sytemwide: /etc/environment) export NO_AT_BRIDGE=1 /usr/share/dbus-1/services/org.a11y.Bus.service   NoExtract = usr/share/dbus-1/accessibility-services/org.a11y.*  # no leading slash in /etc/pacman.conf        sudo rm /usr/share/dbus-1/accessibility-services/org.a11y.*  killall at-spi2-registryd; killall at-spi-bus-launcher  

cmus

 pacman -S cmus adding music Press 5 to switch to the file-browser view.To add music to your cmus library, use the arrow keys to highlight a file or folder, and press a. playing music Press 2 to go to the simple library view.press Enter to play it. Here's some keys to control play: Press c to pause/unpause Press right/left to seek by 10 seconds Press </ > seek by one minute  Press m to cycle through the different options for this setting. To the right of that (past the "|") cmus shows the state of three toggles. Only toggles which are "on" are shown, so now we only see the C. Here are the toggles: [C]ontinue If this is off, cmus will always stop at the end of the track. You can toggle this setting by pressing shift-C. [R]epeat If this is on (and continue is on), when cmus reaches the end of the group of tracks you're playing (selected with the m key) it will start again from the beginning. Press r to toggle this setting. [S]