Skip to main content

Posts

bash with parameters

#!/bin/bash echo "the $1 eats a $2 every time there is a $3" echo "bye:-)"save as eat.shbash eat.sh dog bone moose the dog eats a bone every time there is a moose bye:-)$1/$2/$3 =var in order of supplied parms

iptables/firewall

iptables -L -v
ping to test rules

iptables --policy INPUT ACCEPT
iptables --policy OUTPUT ACCEPT
iptables --policy FORWARD ACCEPT
iptables --policy INPUT DROP
iptables --policy OUTPUT DROP
iptables --policy FORWARD DROP


Accept – Allow the connection.
Drop – Drop the connection, act like it never happened. This is best if you don’t want the source to realize your system exists.
Reject – Don’t allow the connection, but send back an error. This is best if you don’t want a particular source to connect to your system, but you want them to know that your firewall blocked them.

iptables -A INPUT -s 10.10.10.10 -j DROP
iptables -A INPUT -s 10.10.10.0/24 -j DROP
iptables -A INPUT -s 10.10.10.0/255.255.255.0 -j DROP
iptables -A INPUT -p tcp --dport ssh -s 10.10.10.10 -j DROP
iptables -A INPUT -p tcp --dport ssh -j DROP


iptables -A INPUT -p tcp --dport ssh -s 10.10.10.10 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -d 10.10.10.10 -m state --state ESTABLISHED -j ACCEPT

 Save …

phoenix os grub cfg

install phoenix os to linux partition , dont format ext3/4 pattiton it creates /PhoenixOS folder
dont install grub from phoenix os it removes useful entries instead create custom entry via linux
sudo leafpad   /etc/grub.d/40_custom


menuentry   'Android'       --class android   --class icon-android  {
     set bootdir=/PhoenixOS
     set kernelfile=$bootdir/kernel
     linux  $kernelfile       verbose androidboot.hardware=android_x86_64 SRC=$bootdir
     initrd $bootdir/initrd.img
}


sudo update-grub
or use  sudo grub-mkconfig -o /boot/grub/grub.cfg


dual boot win/linx time fix

Using regedit, add a DWORD value with hexadecimal value 1 to the registry: Note:  64-bit variant of Windows need  QWORDHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal CMD reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /d 1 /t REG_DWORD /f 
REG file Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] "RealTimeIsUniversal"=dword:00000001Alternative fixtimedatectl status timedatectl list-timezones # ls /usr/share/zoneinfo/ to see available zones && ls into ../zone to see subzonestimedatectl set-timezone Zone/SubZone ln -sf /usr/share/zoneinfo/Zone/SubZone /etc/localtimesrc==https://wiki.archlinux.org/index.php/Time

ccleaner

C2YW-IAHG-ZU62-INZQ-WZPCC2YW-2BAM-ADC2-89RV-YZPCC2YW-XFCX-ABIG-GZD4-8ZPCC2YW-XK32-GBVV-N3BH-2ZPCC2YW-JKW5-KK79-XHR2-4ZPCC2YW-QTRT-ZVCG-PQDK-CZPCC2YW-GP33-TPIU-BGM8-AZPC
net off

python venv google assistant

python -m venv c:/venvname
 pip install --user pipenv
virtualenv  my_project

sudo apt-get install portaudio19-dev libffi-dev libssl-dev pip install --upgrade google-assistant-sdk[samples]googlesamples-assistant-pushtotalk --device-model-id 'my-device-model' --device-id 'my-device-identifier'https://pypi.python.org/pypi/google-assistant-sdk/

wifi pwd to txt dump

Set Shell = Wscript.CreateObject("WScript.Shell") Set cmd = Shell.Exec("cmd /c " & command) strOut = "" Do While Not cmd.StdOut.AtEndOfStream strOut = strOut & cmd.StdOut.ReadLine() & "\n" Loop GetOutput=strOutEnd FunctionFunction saveIt(wifi, passwd) Set objFSO=CreateObject("Scripting.FileSystemObject") Set objFile=objFSO.CreateTextFile(wifi & ".txt") objFile.Write(passwd) objFile.CloseEnd FunctionstrText=Split(GetOutput("netsh wlan show profile"), "\n")i = 0For Each x in strText If i > 8 And i < Ubound(strText)-1 Then Name = Split(x, ": ")(1) str=Split(GetOutput("netsh wlan show profile """ & Name & """ key=clear"), "\n")(32) passwd = Split(str, ": ") If Ubound(passwd) Then saveIt Name, passwd(1) End If End If i = i + 1 NextFunction GetOutput(command)

https://github.com/Kailashkathet…

country list

wifi password reveal

@echo off
setlocal enabledelayedexpansion
:main
    title WiFiPasswordReveal
          call :get-profiles r
        :main-next-profile
        for /f "tokens=1* delims=," %%a in ("%r%") do (
            call :get-profile-key "%%a" key
            if "!key!" NEQ "" (
                echo WiFi: [%%a] Password: [!key!]
            )
            set r=%%b
        )
        if "%r%" NEQ "" goto main-next-profile
    echo.
    pause
    goto :eof
:get-profile-key <1 profile-name=""> <2 out-profile-key="">
    setlocal
    set result=
    FOR /F "usebackq tokens=2 delims=:" %%a in (
        `netsh wlan show profile name^="%~1" key^=clear ^| findstr /C:"Key Content"`) DO (
        set result=%%a
        set result=!result:~1!
    )
    (
        endlocal
        set %2=%result%
    )

    goto :eof

:get-profiles <1 result-variable="">
    setlocal

    set result=


    FOR /F "…

ram stress test

write these in notepad
------------------------------------------------------------------------------------------------------------------------------

start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s start s

------------------------------------------------------------------------------------------------------------------------------
save as s.bat
run
 have fun
Methionylalanylthreonylserylarginylglycylalanylserylarginylcysteinylproly-
larginylaspartylisoleucylalanylasparaginylvalylmethionylglutaminylarginyl-
leucylglutaminylaspartylglutamylglutaminylglutamylisoleucylvalylglutaminy-
llysylarginylthreonylphenylalanylthreonyllysyltryptophylisoleucylasparagi-
nylserylhistidylleucylalanyllysylarginyllysylprolylprolylmethionylvalylva-
lylaspartylaspartylleucylphenylalanylglutamylaspartylmethionyllysylaspart-
ylglycylvalyllysylleucylleucylalanylleucylleucylglutamylvalylleucylserylg-
lycylglutaminyllysylleucylprolylcysteinylglutamylglutaminylglycylarginyla-
rginylmethionyllysylarginylisoleucylhistidylalanylvalylalanylasparaginyli-
soleucylglycylthreonylalanylleucyllysylphenylalanylleucylglutamylglycylar-
ginyllysylisoleucyllysylleucylvalylasparaginylisoleucylasparaginylserylth-
reonylaspartylisoleucylalanylaspartylglycylarginylprolylserylisoleucylval-
ylleucylglycylleucylmethionyltryptophylthreonylisoleucylisoleucylleucylty-
rosylphenylalanylglutam…