create live iso from running ubuntu

To create a live ISO image from a running Ubuntu 22.40 system, you can use the “Remastersys” tool, which allows you to create an image of your current system, including all installed applications and configurations, and then package it into a bootable ISO file. 

Here’s a breakdown of the process:

1. Install Remastersys:

  • Add the Remastersys repository: In Programs and Updates, go to the “Other” tab and press “Add…”.
  • Add the Remastersys PPA: Look for two lines with “www.remastersys.com/” in the list and check both boxes.
  • Install Remastersys: Open the Ubuntu Software Center and search for “Remastersys” and install it. 

2. Create the ISO Image:

  • Open Remastersys: Launch the Remastersys application.
  • Select “Create Remastersys”: Choose the option to create a live image.
  • Follow the prompts: Remastersys will guide you through the process of creating the ISO image.
  • Choose the output directory: Specify where you want to save the generated ISO file. 

3. Create a Live USB (Optional):

  • Download the ISO image: Once the ISO is created, you can use it to create a bootable USB drive. 
  • Use a tool like Startup Disk Creator: Use the Startup Disk Creator application (installed by default on Ubuntu) to write the ISO image to a USB drive. 
  • Alternatively, use Balena Etcher: Another option is to use Balena Etcher

Important Notes:

  • Backup your system:Before creating the ISO, it’s always a good idea to back up your important data. 
  • Test the ISO:After creating the ISO, test it by booting from it to ensure that it works as expected. 
  • Consider using a different tool:If Remastersys doesn’t work for you, you can explore other tools like Cubic (Custom Ubuntu ISO Creator). 

Why multiple windows support for Flutter desktop apps is needed

One current limitation that Flutter desktop apps have is that they are confined to a single window. This makes sense on mobile where an app takes up the whole screen but for Flutter desktop apps there’s much more space to take advantage of. We know that many members of the Flutter community – including us here at Canonical – have been waiting patiently to break out of that single window.

Canonical has a long history of working with graphical environments having produced Ubuntu Desktop for over 20 years. We want to make sure that the Flutter multi-window support works across a diverse range of desktops including all of those across the extremely varied Linux ecosystem. We’re also thinking ahead about how to make sure Flutter desktop apps continue to work well as the concept of a desktop becomes more diverse.

Proposed solution for Flutter desktop apps

Desktop applications are made up of multiple windows that are used for all sorts of things, including tooltips, dialogs and menus. In the comparison below you can see the same Flutter desktop app running with the current version of Flutter on the left, and the multi-window version on the right. Notice how the app on the right feels more integrated: menus and tooltips are better aligned to the mouse cursor instead of being shifted or cropped to fit inside the window.Comparison of single window (old) vs multi-window (new)

The best thing about the approach we’ve taken is both apps above are using the same standard Flutter Material widgets – the multi-window support is applied automatically. If the app is run in a situation where multi-window is not applicable (e.g. mobile), the app will revert to the traditional behaviour.

When you’re ready to build a more complicated multi-window app this is easy to do as each window just fits into the Flutter widget tree.

Details for seasoned Flutter developers: you’ll need to make a small update to the runner, and if you have an unmodified runner this is easy to migrate. A small change is also required to the main function in the Dart code.

How long will Ubuntu 20 be supported?

Ubuntu long-term support releases (LTS) are released every 2 years by Canonical. Canonical provides patching and maintenance for Ubuntu LTS releases for 5 years for all packages in the main repository. For Ubuntu 20.04 LTS, this support will last until 31 May 2025.

file search and delete in ubuntu command line

Search file using name

find -name "*.php" -printf "%s %p\n"

find -name “*.php” -printf “%s %p\n” -delete

Search file using name and count number of file

find -name “index.php” -printf “%s %p\n” | wc -l

Cannot open the disk ‘D:\ubuntu\Ubuntu 64-bit.vmdk’ or one of the snapshot disks it depends on.

All you have to do is to delete the .lck file from the folder of your vmdk files. It is generally present at C:\Users\UserName\Documents\Virtual Machines\VMWareName

Also you can just move the lck files one folder up to ensure you do not delete any other file by mistake.

delete all files in ubuntu which size is 0kb

to delete the files

find . -type f -size 0b -delete

Use the Find command to find files by size and print file names to standard output.

find . -type f -size 0b -print

send email using python in ubuntu

import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
import datetime
import pytz
import time
import sys
tz_NY = pytz.timezone('Asia/Kolkata')
x = datetime.datetime.now(tz_NY)
# list of email_id to send the mail
li = ["adityaypi@yahoo.com", "rcmaditya@gmail.com","adityaypi@live.com","aditya@peakecorp.com"]
msg = MIMEMultipart()
msg['From'] = "aditya@peakecorp.com"
x = datetime.datetime.now(tz_NY)
for dest in li:
 try:
    subject = 'Admin Notofication'+ x.strftime('%m/%d/%Y %H:%M:%S')+" "+dest
    msg['To'] = dest
    msg['Subject'] = subject
    body = 'Latest FI Prices '+x.strftime('%m/%d/%Y %H:%M:%S')+' Attached'
    msg.attach(MIMEText(body,'html'))
    text = msg.as_string()
    s = smtplib.SMTP('smtp.gmail.com', 587)
    s.starttls()
    s.login("aditya@peakecorp.com", "app password")
    s.sendmail("", dest, text)  
    s.quit()
    time.sleep(1)
 except Exception as e:
    sys.stderr.write(str(e)+'\n')
    sys.stderr.flush()

Send secure email using python in ubuntu server

import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
import datetime
import pytz
import time
import sys
tz_NY = pytz.timezone('Asia/Kolkata')
x = datetime.datetime.now(tz_NY)
# list of email_id to send the mail
li = ["adityaypi@yahoo.com", "rcmaditya@gmail.com","adityaypi@live.com","aditya@peakecorp.com"]
msg = MIMEMultipart()
msg['From'] = "aditya@peakecorp.com"
x = datetime.datetime.now(tz_NY)
context = ssl.create_default_context()
for dest in li:
 try:
    subject = 'Admin Notofication'+ x.strftime('%m/%d/%Y %H:%M:%S')+" "+dest
    msg['To'] = dest
    msg['Subject'] = subject
    body = 'Latest FI Prices '+x.strftime('%m/%d/%Y %H:%M:%S')+' Attached'
    msg.attach(MIMEText(body,'html'))
    text = msg.as_string()
    s = smtplib.SMTP_SSL('smtp.gmail.com', 465, context=context)
    #s.starttls()
    s.login("aditya@peakecorp.com", "app password")
    s.sendmail("", dest, text)  
    s.quit()
    time.sleep(1)
 except Exception as e:
    sys.stderr.write(str(e)+'\n')
    sys.stderr.flush()

remove service from systemctl in ubuntu

systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /usr/lib/systemd/system/[servicename] 
systemctl daemon-reload
systemctl reset-failed

uninstall nginx ubuntu

Removes all but config files.

sudo apt-get remove nginx nginx-common

Removes everything.

sudo apt-get purge nginx nginx-common

After using any of the above commands, use this in order to remove dependencies used by nginx which are no longer required.

sudo apt-get autoremove
sudo apt remove --purge nginx*
sudo apt autoremove
sudo apt update
sudo apt install nginx