Friday, December 23, 2022

 500 Internal Server Error while opening jupyter notebook or making a new notebook file. 


for finding out what's causing the error , enter the command jupyter notebook in the terminal

Most of us launch anaconda-navigator to use jupyter notebook, if we do that we wont get the token (shown below) of the notebook session.


if you find something like this in the lof of  jupyter-notebook command in terminal. there is an issue with nbconvert

PermissionError: [Errno 13] Permission denied: ‘/usr/local/share/jupyter/nbconvert/templates/conf.json’
[E 13:17:24.525 NotebookApp] {


you might have to down grade it to nbconvert 5.6.1, use pip install nbconvert==5.6.1

#YOU SHOULD RUN IT TWO TIMES.



Wednesday, August 4, 2021

 Issues faced in Phantom-Evasion


 Zipalign doesnt allow the file to be built again

 While resigning apk, you may find this error

"Exception in thread "main" java.io.FileNotFoundException: (No such file or directory)  

Check for Zipalign , a line above resigning apk, you will find an error in zipalign


Solution: remove libbacktrace.so.0 and build from official repo

https://packages.debian.org/buster/amd64/android-libbacktrace/download

download and install

dpkg -i filename.deb

run zipalign in terminal again to see if the error is gone. Enjoy !!

 

 

msf_smali error

This error arise when the rebuilding fails. Just delete the msf_smali from the /opt/Phantom-Evasion and run phantom again. 

 

 

Sunday, January 22, 2012

stopping unwanted process in linux

Ubuntu Linux Stop a Process


How do I stop a process under Ubuntu Linux using command line and GUI tools?

You can use the following tools to stop a process under Ubuntu Linux:
  1. System Monitor application - A gui tools displays current active processes. it also provides detailed information about individual processes, and enables you to control active processes i.e. kill or end process.
  2. kill command - Send signal to a process such as kill or end a process.
  3. pkill command - Find processes or processes based on name and send end or kill singles to processes.
  4. killall command - Kill processes (including all its children) by name.

Gnome: System Monitor Application To Kill a Process

To start System Monitor GUI, click on System menu > Select Administration > System Monitor. Alternatively, open a command-line terminal (select Applications > Accessories > Terminal), and then type:
$ gnome-system-monitor
Click on Processes Tab:
Fig.01: A list of process  and end Process button
Fig.01: A list of process and end Process button

How Do I End a Process?

  • First select the process that you want to end.
  • Click on the End Process button. You will get a confirmation alert. Click on "End Process" button to confirm that you want to kill the process.
  • This is the simplest way way to stop (end) a process.

kill Command Line Option

You can use the kill command to send a signal to each process specified by a process identifier (PID). The default signal is SIGTERM (15).
$ ps aux | grep firefox
To end a process, enter:
$ kill -s 15 PID-HERE
$ kill -s 15 2358

OR send signal 9 (SIGKILL) which is used for forced termination to PID # 3553:
$ kill -9 PID-HERE
$ kill -9 3553


pkill Command Line Option

The pkill command allows you to kill process by its name, user name, group name, terminal, UID, EUID, and GID. In this example, kill firefox process using pkill command for user vivek as follows:
$ pkill -9 -u vivek firefox

killall Command Line Option

The killall command sends a signal to all processes. To terminate all httpd process (child and parent), enter:
$ sudo killall -9 httpd
OR
$ sudo killall -9 apache2


source: http://www.cyberciti.biz

Show All Running Processes in Linux and handle them

Show All Running Processes in Linux


You need to use the ps command. It provide information about the currently running processes, including their process identification numbers (PIDs). Both Linux and UNIX support ps command to display information about all running process. ps command gives a snapshot of the current processes. If you want a repetitive update of this status, use top command.

ps command

Type the following ps command to display all running process:
# ps aux | less
Where,
  • -A: select all processes
  • a: select all processes on a terminal, including those of other users
  • x: select processes without controlling ttys

Task: see every process on the system

# ps -A
# ps -e

Task: See every process except those running as root

# ps -U root -u root -N

Task: See process run by user vivek

# ps -u vivek

Task: top command

The top program provides a dynamic real-time view of a running system. Type the top at command prompt:
# top
Output:
Fig.01: top command: Display Linux Tasks
Fig.01: top command: Display Linux Tasks
To quit press q, for help press h.

Task: display a tree of processes

pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.
$ pstree
Sample outputs:
Fig.02: pstree - Display a tree of processes
Fig.02: pstree - Display a tree of processes

Task: Print a process tree using ps

# ps -ejH
# ps axjf

Task: Get info about threads

Type the following command:
# ps -eLf
# ps axms

Task: Get security info

Type the following command:
# ps -eo euser,ruser,suser,fuser,f,comm,label
# ps axZ
# ps -eM

Task: Save Process Snapshot to a file

Type the following command:
# top -b -n1 > /tmp/process.log
Or you can email result to yourself:
# top -b -n1 | mail -s 'Process snapshot' you@example.com

Task: Lookup process

Use pgrep command. pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to screen. For example display firefox process id:
$ pgrep firefox
Sample outputs:
3356
Following command will list the process called sshd which is owned by a user called root:
$ pgrep -u root sshd

Say hello to htop and atop

htop is interactive process viewer just like top, but allows to scroll the list vertically and horizontally to see all processes and their full command lines. Tasks related to processes (killing, renicing) can be done without entering their PIDs. To install htop type command:
# apt-get install htop
or
# yum install htop
Now type the htop command at the shell prompt:
# htop
Sample outputs:
Fig.03: htop - Interactive Linux / UNIX process viewer
Fig.03: htop - Interactive Linux / UNIX process viewer (click to enlarge)

atop program

The program atop is an interactive monitor to view the load on a Linux system. It shows the occupation of the most critical hardware resources (from a performance point of view) on system level, i.e. cpu, memory, disk and network. It also shows which processes are responsible for the indicated load with respect to cpu- and memory load on process level; disk- and network load is only shown per process if a kernel patch has been installed. Type the following command to start atop:
# atop
Sample outputs:
Fig.04: Atop Command in Action
Fig.04: Atop Command in Action


source -  http://www.cyberciti.biz/

setting up IRC eggdrop bot

setting up IRC eggdrop bot 


http://ubuntuforums.org/showthread.php?t=1028042

or follow below

I needed to setup an IRC channel bot and battled with it for almost a week. Finally I've done it and am pleased to share this hassle-free tutorial with the Ubuntu community.

What this will do for you:
1. Setup an IRC channel of your choice
2. Keep a bot nickname of your choice in the channel to keep it alive

Tutorial begins here:
1. First install eggdrop using apt-get or synaptic if you prefer that:

Code:
sudo apt-get install eggdrop
2. Download the simple.conf file from here: http://www.egghelp.org/files/conf/simple.conf.gz and unpack it.
Code:
cd ~
wget http://www.egghelp.org/files/conf/simple.conf.gz
gunzip simple.conf.gz
3. Open the simple.conf file in your home directory with a text editor of your choice (vi, nano, pico whatever). I'll use nano in my example because that's what I'm most familiar with:
Code:
nano simple.conf
4. Now we are editing the simple.conf configuration file. This simple file has very self-explanatory comments to explain what each setting does. Edit them to suit your needs. There are very few things you need to change, and each line has instructions preceding it. The only thing you must take care of is this line:
Code:
set username "user"
Here, you should replace the user within the quotes to your local username in the Ubuntu. If you don't know your local username, you can use whoami command to find it
If you still need help with a particular line in the simple.conf file, please ask here and I'll try to answer.
5. For some reason, I could get eggdrop to work only from /usr/lib/eggdrop directory, and only as a regular user (sudo will not work). So let's make the eggdrop directory writable first:
Code:
sudo chmod 777 /usr/lib/eggdrop -R
(777 is not the most secure setting but it's good to begin with. You should try to lower this number later and use the lowest number that works for you)
6. Now let's run eggdrop for the first time using the simple.conf file.
Code:
/usr/lib/eggdrop -m ~/simple.conf
Notice closely the terminal for any errors. Also login to the IRC channel you created to see if the bot is actually there. If everything goes fine, Eggdrop will create the channel or join if it already exists, and will sit there nicely.
7. in the IRC channel, you will also be given instructions to prove your ownership of the bot. By default, you can send HELLO as a private message to the bot and it'll recognize your ownership. Remember to login to IRC using the same nickname as you defined in the simple.conf file in the bot owner section.
Code:
/msg yourbotname HELLO
(replace yourbotname with the bot nick you set in the simple.conf file)
8. Now let's set this bot to start with the Ubuntu startup.
First make a shell script that starts eggdrop with your conf file:
Code:
 sudo nano /etc/init.d/eggbot
Text editor will open up. Type this:
Code:
#!/bin/sh
Echo "Starting Eggdrop IRC bot..."
cd /usr/lib/eggdrop
sudo -u username eggdrop /home/username/simple.conf
(remember to replace username with your user name in Ubuntu)
Press ctrl+O to write the file, and then ctrl+X to exit the text editor.
9. Now let's make the file executable.
Code:
 sudo chmod a+x /etc/init.d/eggbot
10. Finally let's tell the system about the new file named eggbot we put in /etc/init.d directory so it updates its information:
Code:
 sudo update-rc.d eggbot defaults
That's it!

If you're like me (and don't know much about Linux) you want to restart your computer to see if it actually works. Always check the IRC channel to see if the bot showed up there.

If you can contribute anything to this thread, or want to ask any questions, go ahead.

setting up an IRC server on linux

watch this video , this blog is intended for me myself , so i am not elaborating much



setting an IRC server on your linux machine





sorry for the poor video quality , the three command required are