Su root

Posted: 20 Δεκεμβρίου 2022 in linux
Ετικέτες:

f you do remember your own password, you can run following at Terminal to change password of root:

Code: Select all

sudo passwd root

It will ask for your password, and then you can enter a new password for root. I’m unsure why you need this though, stay away from root man :wink:

Top

How to setup ADB on Linux

Posted: 16 Φεβρουαρίου 2022 in Uncategorized

  • Download the Android SDK platform tool on your pc. Download link in the below section. (Link to download section)
  • Extract the file you can accessible easily For example (Desktop)
  • Open terminal on your LINUX
  • In the terminal, go to the folder where you just extracted ADB. enter the following command cd /path/to/extracted/folder/
  • For example cd /Users/Doug/Desktop/platform-tools/
  • Connect your smartphone to your computer with a USB cable. On your smartphone change the usb mode to “file transfer (MTP) mode. 
  • Next, Go to the command prompt and enter the following command to start adb daemon.
  • adb devices
  • On your smartphone popup the  “Allow USB debugging” option. Allow to connect your device to MAC OS
  •  After re-enter command: adb devices
  • If everything went right, the serial number of your Android device will appear at the MAC OS terminal.

Successfully! Now You are able to run any ADB command on your android device!

If you use any type of Linux software based on Debian, Fedora or SUSE on your computer, you should know that there is an even easier way to install the ADB drivers on your computer.

For Debian-based systems, just open a Terminal instance and run the command “sudo apt-get install adb” – without the quotes – and enter the root password. For its part, to carry out the process in Fedora or SUSE the command will be “sudo yum install android-tools”.

As you can see, setting up ADB drivers is not a complicated process if you follow the steps mentioned. In some cases, you can also use tools that perform this process automatically, such as Universal ADB drivers. Whichever method you choose, it is always advisable to have ADB drivers ready when it comes time to perform any kind of advanced operation on an Android device.

Examples of ADB Commands

When you use the ADB commands, you obviously have to make sure that the device you want to interact with is actually connected to your computer. Enter adb devices command on your terminal/command prompt.

We have listed some of the most useful adb commands. Let it check out.

  • Shows the list of devices connected and recognized by the PC : adb devices
  • Restarts the connected device : adb reboot
  • Reboots the device in Recovery Mode : adb reboot recovery
  • Reboots the device in Download Mode : adb reboot download
  • Reboots the device into Bootloader : adb reboot bootloader
  • Reboot the device in Fastboot Mode : adb reboot fastboot

Install ADB & Fastboot on Ubuntu 18.04 / Linux Mint 19

Posted: 16 Φεβρουαρίου 2022 in Android, linux
Ετικέτες: ,

How to Install ADB & Fastboot on Ubuntu 18.04 / Linux Mint 19?. Android Debug Bridge (ADB) is a versatile command-line tool that enables you to communicate with a device from a client machine. With adb command, you can perform a variety of device actions, such as the installation of Applications, copying files, run shell commands, debug applications e.t.c.

ADB also provides access to a Unix shell for running commands on the device. ADB works in a client-server model and it includes three components:

  • adbd: This is a daemon running in the background and allows the running of commands.
  • A server: This is a background process running on your development machine to manage communication between the client and the daemon.
  • A client: The client is responsible for sending commands from you local machine to a device over USB connection.

Install ADB & Fastboot on Ubuntu 18.04 / Linux Mint 19

ADB comes included with Google’s Android SDK but the package can be installed independently on Ubuntu 18.04 / Linux Mint 19. Install both ADB & Fastboot by running the commands below.

sudo apt update
sudo apt-get install android-tools-adb android-tools-fastboot

Get ADB version details.

$ adb version
Android Debug Bridge version 1.0.36
Revision 1:7.0.0+r33-2

If you try list for connected devices, ADB server should be started if not already running.

$ adb devices
List of devices attached
daemon not running. starting it now on port 5037 *
daemon started successfully *

The Service can also be started by running:

sudo adb start-server 

How to Enable adb debugging on your device

You must enable USB debugging on your device to use adb over USB. Navigate to system settings, and enable it under Developer options.

To reset your adb host, run:

adb kill-server

Check help page with --help option.

install adb ubuntu linux mint

Check Google ADB documentation for more details.

Chirp Connection Issues using Ubuntu

Posted: 1 Νοεμβρίου 2018 in Uncategorized

These are not Chirp issues; they are operating system (Linux, Ubuntu) issues. If these notes do not help, get Ubuntu help either through a search or using the Ubuntu support sites.

Symptom with a USB connection

  1. Click Radio then Download from Radio at the top menu bar; a window appears with Port, Vendor and Model
  2. Click Port and from the pull-down list pick the USB option. Usually that is at the bottom of the list with a name like /dev/tty/USB0
  3. An error window appears with words like An error has occured.
  4. Below the error words is something like Permission denied

Symptom with a serial (RS232) connection

  1. Click Radio then Download from Radio at the top menu bar; a window appears with Port, Vendor and Model
  2. Click Port and from the pull-down list pick the serial port (TTY) with a name like /dev/ttyS0. You may have to experiment to find which port number is active. Another common connection is /dev/ttyS4.
  3. An error window appears with words like An error has occured.
  4. Below the error words is something like Permission denied

Solution

The most common cause is that the user(s) do not have permission to use the serial-USB connection. Permission must be established for the user. There is much more on this common issue in Linux or Ubuntu wikis and support websites.

  1. Start a terminal session.
  2. Enter this this command into the terminal session: sudo gpasswd --add ${USER} dialout

 

or on Debian based systems is usually solved by adding the user to the group dialout
e.g.: sudo adduser USER dialout

 

 

  1. Logout and login again on any sessions you want to see the new group.
  2. After executing the command, check that it worked with: groups ${USER}
  3. The user name will be followed by a list that includes dialout. Dialout means permission for the TTY set that includes serial and USB connections.

Another option you can employ is xkill. This is preinstalled in Ubuntu, but you can install it via the Terminal (which you can open with CTRL + ALT + T) if necessary. When called, xkill will enable you to close any desktop app. Install it with the following command:

sudo apt-get install xorg-xkill

Once this is done, run xkill by simply typing

xkill

Your mouse pointer will then display a cross (or a skull), and all you need to do is left-click on the offending application.

If it’s not possible to close your unresponsive app with any of these desktop-focused methods, the solution might be the command line…

1) Download a driver for linux from Samsung. Samsung M2070 Linux Printer/Scanner Driver (15.87 MB) is at http://www.samsungdrivers.net/samsung-m2070-driver/

2) Unzip your downloaded file.

3) Make sure about the location of the directory which contains a file named » install.sh «. It must be in downloads/XXXX(You named!!)/ uld.

I repeat. » install.sh » is in ULD.

4) Open TERMINAL to go to the directory which has » install.sh » in it.

cd downloads

cd XXXX

cd uld

5) Install a driver by command.

sudo ./install.sh

Note that you have to hit «Enter» many many times to reach the line which asks you to choose y/n. Go slow. Otherwise you’ll have to go back to the directory of ULD and command again.

Send Email when IP Address Changes

Posted: 6 Μαρτίου 2018 in linux
Ετικέτες: , , , ,

Εγκατάσταση msmtp σε  GNU/Linux για να στέλνουμε  emails από το  gmail

Βήμα 1: Κάνουμε εγκατάσταση μέσω τερματικού τα απαραίτητα πακέτα.

sudo apt-get install msmtp msmtp-mta

Βήμα 2: Δημιουργούμε ένα app password στο  Google λογαριασμό μας για το  msmtp

This (Step 2.* in this tutorial) was the missing piece of the puzzle which weren’t in any of the msmtp tutorials I did through. I found out about it in one of the Postfix tutorials where it was included after many hours of trial and error. Because at first, I thought the msmtp config file where was password field had to be filled with the same password with what you log in as a person to your account.

Go to: https://myaccount.google.com and log into the email account you want to start sending the emails.

Step 2.1: Select Security from the side menu and turn 2-Step Verification ON.

Step 2.2: After that click on App passwords

Step 2.3: Next up select Other (Custom name)

Step 2.4: Fill in the name as msmtp for example

Step 2.5: Get the password for your msmtp configuration file

Save this password to some notepad temporarily so you can copy & paste it later to a configuration file because once you click DONE you cannot see the password again. At least I have not found a way to re-open this popup.

Βήμα 3: Μπαίνουμε στο msmtprc

sudo nano /etc/msmtprc

Βήμα 4: Διαμορφώστε το msmtprc αρχείο

defaults
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log
account        gmail
host           smtp.gmail.com
port           587
from           username@gmail.com
user           username
password       password
account default : gmail

To  username@gmail.com θα πρέπει να αλλαχτεί στο  config file με το email σας

To password με  τον κωδικό του app του google

Αλλάζουμε αν θέλουμε και το username

Βήμα 5:  Κάνουμε τεστ το email

echo "Message" | mail -s "Title" youremailaddress@gmail.com

Μετά την εντολή θα πρέπει να έχεις παραλάβει το email όπου έστειλες

Βήμα 6:  Κάνουμε εγκατάσταση το curl εάν δεν το έχουμε 

apt-get install curl

Βήμα 7:  Δημιουργούμε τα αρχεία 

1. Δημιουργούμε τα παρακάτω κενά αρχεία

erxeteip.txt  

newip.txt

oldip.txt

 

2. The Script

#!/bin/bash
 
#Script to report public IP address change
#By: Soultidis D. Christos
 

curl ipinfo.io/ip > /home/username/emailscript/erxeteip.txt


oldip=`cat /home/username/emailscript/oldip.txt`
erxeteip=`cat /home/username/emailscript/erxeteip.txt`

if [[ $erxeteip = $oldip ]]
then

    #echo $oldip > /home/username/emailscript/oldip.txt
    echo "Kamia allagi"

else
    echo $erxeteip > /home/username/emailscript/newip.txt
echo $erxeteip > /home/username/emailscript/oldip.txt


    cat /home/username/emailscript/newip.txt | mailx -s "Dynamic Public IP Address" youremail@gmail.com

fi
 

Αποθήκευσε το script  σαν  ip.sh εκτελέσιμο και βάλτο σε έναν φάκελο μαζί με τα άλλα αρχεία

π.χ.

/home/username/emailscript/

Βήμα 8:  Cron και χρονική διάρκεια εκτέλεσης του script μας 

3. Cron
Πατάμε την παρακάτω εντολή στο τερματικό

 
crontab -e

Προσθέτουμε  αυτό ώστε να μπορεί να τρέχει το  script  ανα 5 λεπτά

*/5 * * * * /home/username/emailscript/ip.sh >/dev/null 2>&1

(Το 5 δηλώνει τα λεπτά , βάζουμε όσο θέλουμε εμείς)

Αποθήκευση

Γράφουμε στο τερματικό :

pgrep cron 

Άμα δεν βλέπουμε αριθμό ο  cron δεν τρέχει. Έτσι πατάμε  sudo /etc/init.d/cron start  για να ξεκινήσει

Τέλος

site

Posted: 3 Μαρτίου 2018 in Uncategorized

http://www.github.com

 

Εμφάνιση και άλλων λειτουργικών στο grub

Posted: 14 Νοεμβρίου 2013 in linux
Ετικέτες:

sudo update-grub

The easiest way to enable desktop icons is to use Gnome Tweak Tool. Run sudo apt-get install gnome-tweak-tool, then launch Gnome Tweak Tool from the Gnome Shell menu. It will be called Advanced Settings.

enter image description here

Then, click on the Desktop button. Enable the option that says «Have file manager handle the desktop. Now, any files placed in the Desktop folder inside your home folder should appear on ther desktop.

Για να επιστρέψουμε λοιπόν τα εικονίδια αρκεί να δώσουμε αυτές τις δύο εντολές.

gsettings set org.gnome.desktop.background draw-background true

gsettings set org.gnome.desktop.background show-desktop-icons true

Για να επιστρέψουμε στην άδεια επιφάνεια εργασίας που είχαμε προηγουμένως δίνουμε τις ίδιες εντολές, αλλά αντί για το true στο τέλος δίνουμε false.