viernes, 22 de octubre de 2021

Install GitBucket

 

 1. Login to your VPS via SSH

ssh user@vps_IP

2. Update the system and install necessary packages

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install software-properties-common git nano wget

3. Install Java 8

To add the webupd8team repository to your sources list and install the latest Oracle Java 8 JDK, run the following commands:

[user]$ sudo add-apt-repository ppa:webupd8team/java
[user]$ sudo apt-get update
[user]$ sudo apt-get install oracle-java8-installer

To check if JAVA has been properly installed on your Ubuntu 16.04 VPS run java -version, and the output should be similar to the following:

[user]$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

4. Install GitBucket

Create a new GitBucket user:

[user]$ sudo adduser --gecos 'Gitbucket User' gitbucket

GitBucket will store all the git repositories in the home directory of the user who will launch the application.

Download latest gitbucket.war from Github. At the time of writing, the latest version is version 4.4.

[user]$ sudo wget -O /home/gitbucket/gitbucket.war https://github.com/gitbucket/gitbucket/releases/download/4.4/gitbucket.war
[user]$ sudo chown -R gitbucket: /home/gitbucket

5. Create systemd service

To create a new systemd service for GitBucket, open your editor of choice and create a new file:

[user]$ sudo nano /etc/systemd/system/gitbucket.service

and add the following code lines:

[Unit]
Description=GitBucket service
After=syslog.target
After=network.target

[Service]
User=gitbucket
ExecStart=/usr/bin/java -jar /home/gitbucket/gitbucket.war --port=8080 --host=127.0.0.1

[Install]
WantedBy=multi-user.target

Start the GitBucket server and set it to start automatically on boot:

[user]$ sudo systemctl enable gitbucket.service
[user]$ sudo systemctl start gitbucket.service

To verify the unit started, run systemctl status gitbucket.service and you should see something like below:

● gitbucket.service - GitBucket service
   Loaded: loaded (/etc/systemd/system/gitbucket.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2016-09-09 18:25:18 CDT; 2s ago
 Main PID: 3578 (java)
   CGroup: /system.slice/gitbucket.service
           └─3578 /usr/bin/java -jar /home/gitbucket/gitbucket.war --port=8080 --host=127.0.0.1

6. Install and configure Nginx

To install the latest stable version of Nginx available on the Ubuntu repositories, run:

[user]$ sudo apt-get -y install nginx

Generate a self signed ssl certificate:

[user]$ sudo mkdir -p /etc/nginx/ssl
[user]$ cd /etc/nginx/ssl
[user]$ sudo openssl genrsa -des3 -passout pass:x -out gitbucket.pass.key 2048
[user]$ sudo openssl rsa -passin pass:x -in gitbucket.pass.key -out gitbucket.key
[user]$ sudo rm gitbucket.pass.key
[user]$ sudo openssl req -new -key gitbucket.key -out gitbucket.csr
[user]$ sudo openssl x509 -req -days 365 -in gitbucket.csr -signkey gitbucket.key -out gitbucket.crt

[user]$ sudo openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
If you don’t want to get warnings associated with self-signed SSL Certificates, you can purchase a trusted SSL certificate here.

Next, create a new Nginx server block:

[user]$ sudo nano /etc/nginx/sites-available/myGitbucket.com
server {
    listen 443 ssl http2;
    server_name myGitbucket.com;

    location / {
        proxy_pass              http://127.0.0.1:8080;
        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout   150;
        proxy_send_timeout      100;
        proxy_read_timeout      100;
        proxy_buffers           4 32k;
        client_max_body_size    500m; # Big number is we can post big commits.
        client_body_buffer_size 128k;
    }

    ssl on;
    ssl_certificate     /etc/nginx/ssl/gitbucket.crt;
    ssl_certificate_key /etc/nginx/ssl/gitbucket.key;
    ssl_dhparam  /etc/nginx/ssl/dhparam.pem;

    ssl_session_timeout 5m;
    ssl_ciphers  EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    access_log  /var/log/nginx/mygitbucket.access.log;
    error_log   /var/log/nginx/mygitbucket.error.log;

}

server {
    listen      80;
    server_name myGitbucket.com;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^ https://$server_name$request_uri? permanent;
}

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/myGitbucket.com /etc/nginx/sites-enabled/myGitbucket.com

Test the Nginx configuration and restart nginx:

[user]$ sudo nginx -t
[user]$ sudo systemctl start nginx

Open http://myGitbucket.com/ in your favorite web browser and you should see the GitBucket home page. The default username and password are both root.

https://www.rosehosting.com/blog/install-gitbucket-on-ubuntu-16-04/

miércoles, 20 de octubre de 2021

2D Animation package - PSB workaround?

 convert ***.psd ***.psb

https://forum.unity.com/threads/2d-animation-package-psb-workaround.619435/

 

I spent last four hours trying to find any solution, and actually did. Yay!

https://imagemagick.org/script/download.php

Use from command line like this:

magick convert base.psd base.psb

(replace 'base.psd' with the name of your psd file, obviously)

Worked for image exported as .psd from Gimp 2.10.8

Hope this helps. GLHF 

 

https://linuxize.com/post/install-rpm-packages-on-ubuntu/

Install Alien

Alien is a tool that supports conversion between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats.

Before installing the alien package, make sure the Universe repository is enabled on your system:

sudo add-apt-repository universe

Once the repository is enabled, update the packages index and install the alien package with:

sudo apt update sudo apt install alien

The command above will also install the necessary build tools.

Converting and Installing an RPM package

To convert a package from RPM to DEB format, use the alien command followed by the RPM package name:

sudo alien package_name.rpm

Depending on the package size, the conversion may take some time. In most cases, you will see warning messages printed on your screen. If the package is successfully converted, the output will indicate that the DEB package is generated:

package_name.deb generated

To install the deb package , you can either use the dpkg or apt utility:

sudo dpkg -i package_name.deb
sudo apt install ./package_name.deb
The package should now be installed, assuming it’s compatible with your system, and all dependencies are met.

 

 

     

lunes, 18 de octubre de 2021

PDF-Editor

 https://icecreamapps.com/es/PDF-Editor/


 

Set Mail SQL SERVER

 We can send an email using the SQL Server. Database mail configuration information is maintained in an MSDB database. It is supporting logging and auditing features, using system tables of MSDB. We can send mail as a text message, HTML, query results, and files as an attachment. We have to follow some simple steps to achieve this.

Step 1. Go to Object Explorer.

Step 2. Expand the management menu, as shown below:

menu

Step 3. Right-click on database mail and select configure database mail, as shown below.

Configure Database Mail

After selecting “Configure Database Mail”, we will get the screenshot as shown below:

Configure Database Mail

Step 4. Click the Next button and after clicking the next button; we will get a new screenshot, as shown below.

Next

Step 5. Select the Radio button on the first option “Set up Database Mail by performing the following tasks” and click the Next button.

We will get a new Screen for setting up the account details for configuring the mail.

Step 6. Enter "Profile name" and "Description", as shown below:

Profile

Step 7. Click ADD button and we will get a new prompt where we can add more details related to the mail setup, as shown below:

  • Account name Enter the name of your new account.
  • Description Enter a description for the account. It is optional.
  • E-mail address Enter your e-mail address, which we will use for sending an e-mail, here you can specify your domain email id also as email@yourDomain.com.
  • Display name Enter the name which will use for displaying the name of the sender and it is optional.
  • Reply e-mail Enter the reply e-mail address, which will use for replies to e-mail messages sent from this account. It is also optional.
  • Server name Enter the IP address of the SMTP server for your e-mail account.
    This server requires a secure connection (SSL) - checked or unchecked as per your e-mail Domain.
  • SMTP Authentication We have to choose one Authentication type among three Authentication types.
    Here, I am using my Gmail account credentials to configure the mail setup. In most cases, we are using a company account.

    new

Step 8. Click OK. This screen will close and the previous screen is shown below.

new

Step 9. Click Next and we will get the prompt.

Step 10. Check the checkbox on “TestMailProfile” and make it the default profile, as shown below.

TestMailProfile

Step 11. Click Next and we will get a new screen.

Step 12. Keep the default setting for the system parameters and click the Next button, as shown below:

default setting

Step 13. Click the Finish button to complete the configuration, as shown below.

Finish

Step 14. It will do all the configurations and then click the close button.

configurations

Now, we are done with the mail configuration. We will test this to send a sample mail, with the help of the following steps.

Step 1. Go to Object Explore

Step 2. Expand the “Management” menu

Step 3. Right Click “Database Mail”

Step 4. Click “send Test E-Mail”, as shown below.

send Test E-Mail

After clicking “send Test E-Mail”, we will get a new screen.

Step 5. Database Mail Profile: Select “TestMailProfile”, as we created just now.

  • To Enter an e-mail Id of the receiver
  • Subject Enter the subject of your e-mail.
  • Body Enter the content of your mail.

Click the “Send Test E-mail” button, as shown below.

Send Test E-mail

An email will be sent to the recipient successfully.

After successfully configuring the Email in the SQL server, we will see how to send Email programmatically, with the help of a system procedure.

We are using the system procedure “sp_send_dbmail” to send an E-mail.

We can see the “sp_send_dbmail” system procedure by using “sp_helptext sp_send_dbmail”

The query will be written as shown below.

Query

We will send the parameters to the “sp_send_dbmail” system procedure, as per our requirement.

Here, I am using the parameters shown below to send an E-mail. 

use msdb
go
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'TestMailProfile',
@recipients = '',
@subject = 'DataBase Mail Test',
@body = 'This is a test e-mail.';
SQL

Explanation

  • Profile name We have to write the profile name which we created now.
  • Recipients we have to write the recipient's email. We can write multiple recipients' e-mail id by separating with ‘;’
  • Subject  We have to write the subject of the e-mail.
  • Body We have to write the body of the e-mail

We can also verify our E-mail status, whether it will successfully send or not, and get other information using the query given below:

use msdb
go
select * from sysmail_allitems
SQL

query

We can also see the database mail log, as shown below.

Mail Log

After clicking “View database Mail Log”, we will get the information about the database mail log, as shown below.

View database Mail Log







https://www.c-sharpcorner.com/article/configure-database-mail-send-email-from-sql-server-database/

https://www.c-sharpcorner.com/article/configure-database-mail-send-email-from-sql-server-database/















Configurar Correo SQL Server

 

 Para poder habilitar el correo de base de datos, ejecute el siguiente código: 

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE
GO
 
-- Create a Database Mail profile  
EXECUTE msdb.dbo.sysmail_add_profile_sp  
    @profile_name = 'Notifications',  
    @description = 'Profile used for sending outgoing notifications using Gmail.' ;  
GO
 
-- Grant access to the profile to the DBMailUsers role  
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp  
    @profile_name = 'Notifications',  
    @principal_name = 'public',  
    @is_default = 1 ;
GO
 
-- Create a Database Mail account  
EXECUTE msdb.dbo.sysmail_add_account_sp  
    @account_name = 'Gmail',  
    @description = 'Mail account for sending outgoing notifications.',  
    @email_address = 'Use a valid e-mail address',  
    @display_name = 'Automated Mailer',  
    @mailserver_name = 'smtp.gmail.com',
    @port = 465,
    @enable_ssl = 1,
    @username = 'Use a valid e-mail address',
    @password = 'Use the password for the e-mail account above' ;  
GO
 
-- Add the account to the profile  
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp  
    @profile_name = 'Notifications',  
    @account_name = 'Gmail',  
    @sequence_number =1 ;  
GO
 
--test
EXEC msdb.dbo.sp_send_dbmail
     @profile_name = 'Notifications',
     @recipients = 'Use a valid e-mail address',
     @body = 'The database mail configuration was completed successfully.',
     @subject = 'Automated Success Message';
GO
 

https://www.sqlshack.com/es/como-poder-configurar-la-base-de-datos-del-correo-en-sql-server/

 https://www.c-sharpcorner.com/article/configure-database-mail-send-email-from-sql-server-database/

viernes, 15 de octubre de 2021

VM share folder

mount new folder

sudo mount -o uid=1000,gid=1000 -t vboxsf YOUR_SHARE_FOLDER /home/linux/documents



jueves, 14 de octubre de 2021

New Job Sql Server

 

https://i.stack.imgur.com/MViKk.gif 

https://stackoverflow.com/questions/5471080/how-can-i-schedule-a-job-to-run-a-sql-query-daily

Choco Windows

 

Chocolatey is a windows package manager meaning software can be installed through shell commands. This enables software to be installed, upgraded and uninstalled via scripts.

I’ve started to try using Chocolatey across my different devices in an effort to keep them in sync with the different programs. Although the commands must be run on the individual devices, it’s very helpful to have a list of packages installed which I’m maintaining in this post (see below).

Next time I set up a machine I’ll just need to follow the below instructions and let Chocolatey do much of the heavy lifting.

Initial set up

Chocolatey asks for confirmation before any install, although sensible this can become tiresome. To avoid this you can set a -y flag on every choco install command or set the following global chocolatey flag to make life easier.

choco feature enable -n allowGlobalConfirmation

Search for packages

Chocolatey seems to have a lot of the programs you may wish to install but it’s not always obvious what the package name is. This is where the search command comes in.

choco search <package>

I’ve recently started to use the package search on the website instead as easier to find the relevant package. https://chocolatey.org/packages

Choco installs

Here is my list of packages that I usually install. I’ll be aiming to keep this list up to date so I’ve a reference of my installed packages as a gist.

choco install 7zip
choco install autohotkey
choco install curl
choco install nodejs
choco install openssh --pre

You can also see what packages you have installed with

choco list --localonly

Upgrade installed package versions

To check which packages are outdated but not perform any updates, run the following.

choco outdated

To upgrade these outdated packages you can either upgrade a single package. NOTE: upgrade is the correct command here, update is being depreciated in version 1.0

choco upgrade <package>

or upgrade them all in a single command

choco upgrade all

Upgrade Chocolatey itself

Inevitably from time to time Chocolatey itself will need to be upgraded. The above commands will work but for reference, here is the command to only upgrade Chocolatey.

choco upgrade chocolatey

Uninstall packages

choco uninstall <package>

 

https://richardballard.co.uk/chocolatey/

How to Search a Single Domain


Usually searching an entire domain casts too wide a net, but if you are searching for government information, for example, you could search just within .gov sites by entering only the domain for the name. For example:

site:.gov seized property ohio

This site search is confined to all the websites in the .gov domain.

If you know the specific government agency, it is better to add it to filter your results further. For example, if you seek tax information results only from the IRS website, use:

site:IRS.gov estimated taxes