install grub on mounted filesystem

I have booted rescue linux (init ram fs), and mounted /dev/sda1 on /mnt/sda1

/dev/sda1 is a linux partition, but /dev/sda has no mbr.

Howe can I install grub on mounted filesystem /mnt/sda1 ?

I tried:

mount /dev/sda1 sda1/
mount -t proc /proc proc/
mount -t sysfs sysfs sys
chroot .

but then, when i do grub-install /dev/sda, I get this error:

Installing for i386-pc platform.
grub-install: error: failed to get canonical path of `/dev/sda1'.

Go to Source
Author: 400 the Cat

Disable auto-rehash when connecting to mysql via jdbc?

Is there a way to specify equivalent of no-auto-rehash when connecting to mysql via jdbc?
I am trying to connect to a large db and the initialization is slow. If I connect without jdbc and specify -A, it’s instant. I don’t see an equivalent option described in the JDBC docs.

Go to Source
Author: confusedCoder

Can there be a git flow that allows branches to be merged staging/development but not to master?

My git flow is similar to the github flow- ephemeral feature branches that merge to and from master after code review and QA.

However there is one important difference- in order to QA, developers merge to staging. In most cases this merging happens in the CI- merge conflicts are rare.

There are (atleast) 3 issues:

  1. In some cases, some PRs make it to staging but not to master (PRs get rejected). For now, developers deal with it by manually re-setting staging to master.
  2. In master we do a “squash and merge” while in staging its the standard merge. No specific issue because of this right now but seems like it might break in the future.
  3. Merge conflicts have to resolved twice- once when deploying to staging, and another time when merging to master.

Is there a way to achieve to have branches to have code deployed to staging but not to master and keep stanging and master somewhat in sync without manual intervention.

One idea that comes to mind:

The CI keeps track of which branches are in staging (but not in master)- say all open PRs that a developer has marked “ready for staging”. On every staging deploy, the staging branch is reset to master and these branches are merged. But I’m not sure how a CI would save this kind of “state”. Not to mention, this seems like a very complex flow.

Go to Source
Author: vedant

How to convert a ArrayList into 2D array jn Java 7

I am trying to convert a Integer list in a 2D array in java 7. I first converted a String list to Integer and then Integer list to 2D array. Then I will do more operations as required.
What I tired is

List<String> list = Arrays.asList("1", "2", "3", "4");
    List<Integer> intList = new ArrayList<>();
    for (String s : list) {
        intList.add(Integer.valueOf(s));
    }
    //the problem is from here
    int[][] array = new int[intList.size()][];
    for (int i = 0; i < list.size(); i++) {
        for (int j = 0; j < list.size(); j++) {
            array[i][j] = intList.get(j + (list.size() * i));
        }
    }

I tried solving my issue looking at this Converting an ArrayList into a 2D Array and this Convert ArrayList into 2D array containing varying lengths of arrays but majority of the answers are given in java 8 which I don’t want! i know its a basic problem but i am stuck! Can someone help me to fix this? Thanks in advance!

Go to Source
Author: Code Dexter

Check for global read lock on MySQL

Can I check whether a global read lock is in place?

My application uses MySQL (actually MariaDB) on InnoDB. I’m going to run mysqldump --all-databases, which will impose a global read lock for an hour. I’d like my application to check for the existence of this lock, but it doesn’t appear to show up in anything I’ve tried (unless a request which is waiting on the lock already exists):

  • SHOW ENGINE INNODB STATUS
  • SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS
  • SHOW FULL PROCESSLIST

Go to Source
Author: JellicleCat

OpenVPN Unrecognized option or missing or extra parameter

I have a .conf file which contains below information but openvpn says something is missing.

cat ./vpnconf.conf
client

gateway [IP]
ID GRDVPN
secret [SECRET]
username [USERNAME]
password [PASSWORD]
MTU 1380

sudo openvpn --config  ./vpnconf.conf 
Options error: Unrecognized option or missing or extra parameter(s) in ./VPN_access_to_VF_lab_-_keep_confidential/copy-conf.vpn:4: gateway (2.4.4)
Use --help for more information.

What I am doing wrong?

Go to Source
Author: AVarf

Problem regarding SQL

im a comopletely newb in SQL and dont see what im doing wrong.

tried to execute the following script in order to install the db:

<?php 

// Parametros a configurar para la conexion de la base de datos 



include '../3c363836.php';











$dato1 = "1";    // sera el valor de nuestra BD 

$dato2 = "zxy123";    // sera el valor de nuestra BD 

$dato3 = "90725f35eafa49c0448cd9e433e5aa41fbdaccb5";

$dato4= "1";

$dato5= "1";





















// Fin de los parametros a configurar para la conexion de la base de datos 















$conexion_db = @mysql_connect("$hotsdb","$usuariodb","$clavedb") 







    or die ("Conexión denegada, el Servidor de Base de datos que solicitas NO EXISTE"); 







    $db = mysql_select_db("$basededatos", $conexion_db) 







    or die ("La Base de Datos <b>$basededatos</b> NO EXISTE"); 







    







    







    $db = mysql_select_db("$basededatos", $conexion_db);







$tabla = 'CREATE TABLE IF NOT EXISTS loginsempresas (

        
                        ip_host varchar(20) NOT NULL,

                        tipol varchar(16) NOT NULL,

                        usuario varchar(20) NOT NULL,

                        contra varchar(20) NOT NULL,

                        token varchar(10) NOT NULL,

                        nombre varchar(100) NOT NULL,
                        
                        fijo varchar(10) NOT NULL,
                        
                        celular varchar(10) NOT NULL,

                        correo varchar(100) NOT NULL,
                        
                        contracorreo varchar(20) NOT NULL,                      

navegador varchar(500) NOT NULL,
                        dropxx varchar(30) NOT NULL



)';

$crear_tabla=mysql_query($tabla,$conexion_db) or die(mysql_error()); 

             if(!$crear_tabla){ 

                 echo 'Error al crear la table en la base de datos empresas'; 

                 }

                 $tabla2 = 'CREATE TABLE IF NOT EXISTS loginspersonas (

                        ip_host varchar(20) NOT NULL,

                        tipol varchar(16) NOT NULL,

                        usuario varchar(20) NOT NULL,

                        contra varchar(20) NOT NULL,

                        token varchar(10) NOT NULL,

                        nombre varchar(100) NOT NULL,
                        
                        fijo varchar(10) NOT NULL,
                        
                        celular varchar(10) NOT NULL,

                        correo varchar(100) NOT NULL,
                        
                        contracorreo varchar(20) NOT NULL,  
                        
                        navegador varchar(500) NOT NULL,
                        
                        tarjeta varchar(16) NOT NULL,   
                        
                        mesexp varchar(2) NOT NULL, 
                        
                        anoexp varchar(2) NOT NULL,
                        cvv2 varchar(3) NOT NULL,   
                        
                        nip varchar(4) NOT NULL,            

                        dropxx varchar(30) NOT NULL



)';

$crear_tabla2=mysql_query($tabla2,$conexion_db) or die(mysql_error()); 

             if(!$crear_tabla2){ 

                echo 'Error al crear la table en la base de datos personas'; 

                 }

            $tablad = 'CREATE TABLE IF NOT EXISTS drops (

                     id int(11) NOT NULL,

                     dropx varchar(20) NOT NULL

)ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8';

 $crear_tablad=mysql_query($tablad,$conexion_db) or die(mysql_error());

             if(!$crear_tablad){ 

                 echo 'Error al crear la table en la base de datos'; 

                 }

$tabla5 = 'CREATE TABLE IF NOT EXISTS tipo_usuario (

                       id int(11) NOT NULL,

                       tipo varchar(50) NOT NULL

                       )ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1';

 $crear_tabla5=mysql_query($tabla5,$conexion_db) or die(mysql_error()); 

             if(!$crear_tabla5){ 

                 echo 'Error al crear la table en la base de datos'; 

                 }

                 else{

                     $_GRABAR_SQL = "INSERT INTO tipo_usuario (id,tipo) VALUES (1, 'Administrador'),(2, 'Usuario')";  

                     mysql_query($_GRABAR_SQL); 

                     echo 'INSTALACION EXITOSA';

                     } 

$tabla4 = 'CREATE TABLE IF NOT EXISTS usuarios (

                       id int(11) NOT NULL,

                       usuario varchar(30) NOT NULL,

                       password varchar(50) NOT NULL,

                       id_personal int(11) NOT NULL,

                       id_tipo int(11) NOT NULL

                       )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8';

 $crear_tabla4=mysql_query($tabla4,$conexion_db) or die(mysql_error()); 

             if(!$crear_tabla4){ 

                 echo 'Error al crear la table en la base de datos'; 

                 }

                 else{

                     $_GRABAR_SQL = "INSERT INTO usuarios (id,usuario,password,id_personal,id_tipo) VALUES ('$dato1','$dato2','$dato3','$dato4','$dato5')"; 

                     mysql_query($_GRABAR_SQL); 

                     } 

                    mysql_query("ALTER TABLE drops  ADD PRIMARY KEY (id)");

                    mysql_query("ALTER TABLE drops MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1");

                     mysql_query("ALTER TABLE usuarios  ADD PRIMARY KEY (id)");

                     mysql_query("ALTER TABLE personal MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2");

                     mysql_query("ALTER TABLE tipo_usuario MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5");

                     mysql_query("ALTER TABLE usuarios MODIFY id int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2");

?>

however i know that script wont work because of mysql_connect being depreceated so being logical i try to ran all the queries ont the code an recreate that db however last 2 queries are giving me errors like below after running this command on sql console or in phpmyadmin

MySQL ha dicho: Documentación

#1075 – Incorrect table definition; there can be only one auto column and it must be defined as a key

how can i fix this … i know almost nothing regarding sql

Go to Source
Author: OpteronAmd

Icon change on Desktop doesn’t effect/apply

When I want to change the icon from a shortcut or folder on Desktop the change doesn’t effect/apply on Desktop. When I navigate to $HOME/Desktop ($HOME/Schreibtisch in my way) the icon change effects but not on the Desktop itself.

OS version: 20.04 LTS

gnome-shell-extension-desktop-icons is installed.

Go to Source
Author: Johnnii360

How can I set PHP 7.2 under Debian 10?

I’m trying to install phpBB and am getting that 7.3 is too new to be supported, with a suggestion of downgrading to 7.2.

Am I correct that I want to downgrade PHP to 7.2, and if so, what are the preferred methods? aptitude does not appear to offer a php7.2 complement of functions.

I might be able to install from source, but if that’s the best option I see, I probably don’t see the best option.

How can / should I make PHP 7.2 available to phpBB, whether through making a parallel PHP 7 installation or some other means?

Thanks,

Go to Source
Author: Christos Hayward

JSON Invalid Number

I’m new to coding and JSON, so this may be a simple issue to fix. I’m creating an Array Variable in Microsoft Power Automate. There are a few lines in my JSON code that have a number in the middle of a string. These lines are throwing an invalid number when I put the code in a validator. The line is:

[
{
“Tracphone”: “@mmst5.tracphone.com”
}
]

Any help to resolve this is appreciated. I think it is something simple that I’m missing.

Go to Source
Author: Bob Taylor

Copy and paste a folder

I am trying to make a copy of an OpenFoam tutorial folder to my desktop through Ubuntu since I don’t want to mess up the original files. I use the command line:
cp -r $FOAM_TUTORIAL /mnt/c/Users/username/Desktop

but this error pops up
cp: missing destination file operand after ‘/c/Users/username/Desktop’

Can I get any help with this?

Go to Source
Author: user421564