aws aurora – Does changing the character set from utf8 to ascii improve consumed space of a CHAR field on mysql?

I have the following table:

CREATE TABLE `tokens` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `s_id` int(10) unsigned NOT NULL,
  `a_token` char(40) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `a_token_exp` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `u_a_token` (`a_token`) USING HASH,
  KEY `f_seid` (`s_id`),
  CONSTRAINT `f_seid` FOREIGN KEY (`s_id`) REFERENCES `sessions` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1

and I want to change the charset for a_token since we use only ascii characters using this command:

ALTER TABLE tokens MODIFY a_token CHAR(40) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL;

and the new SHOW CREATE TABLE shows:

CREATE TABLE `tokens` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id` int(10) unsigned NOT NULL,
  `a_token` char(40) CHARACTER SET ascii NOT NULL,
  `a_token_exp` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `u_a_token` (`a_token`) USING HASH,
  KEY `f_seid` (`s_id`),
  CONSTRAINT `f_seid` FOREIGN KEY (`s_id`) REFERENCES `sessions` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=latin1

and then I run OPTIMIZE TABLE oauth_session_access_tokens.

This query should (I’m not sure) the size of the table for my schema:

SELECT table_name AS "Table",
      ((data_length + index_length)) AS "Size"
FROM information_schema.TABLES
WHERE table_schema = "test"
ORDER BY (data_length + index_length) DESC;

but the specific table tokens always returns 49152 before and after the ALTER TABLE.

Can I suppose that even with CHAR and utf8, if there are only ASCII chars, then the field doesn’t preallocate the space for utf8?

laravel – Changing the file name when open the pdf file in browser using php code

I have an issue while showing the file in browser. Generally I have pdf file to show (may be other). So first here is my code —

  header('Content-Description: File Transfer');
                    header('Content-type:application/pdf');
      //              $filename = "myfile.pdf;
     //               header('Content-Disposition: inline; filename=' . $filename);
    //                header('Content-Transfer-Encoding: binary');
    //                header('Expires: 0');
    //                header('Cache-Control: must-revalidate');
    //                header('Pragma: public');
    //                header('Content-Length: ' . strlen(base64_decode($decodedbase64string)));
    //                ob_clean();
    //                flush();
    //decode the image
                    echo base64_decode($decodedbase64string);
                    return;

It working fine as I am running it in url http://localhost/myproject/get-document as the screenshot attached.
enter image description here

Here in the screenshot the file name seems get-document, but I just need to change it for the file name as custom name put in the variable.

Thanks

forms – Need help to automate changing custom post author to an existing user that is not logged in?

I have a form created with Formidable forms that allows an anonymous submission to nominate an existing user for an award. The award is stored as a custom post type created as a “create post” action and I want to assign the nominee (existing user) as the custom post (award) author without having to manually changing the user id. I would need formidable to check if the nominee named has an account and if the user exists assign the CPT author to that nominee.

My field are:

Nominee Name:
Nominee City:
Award the are Nominated for:

unity – Changing sprite renderer material in gameplay

I’m having an issue on some android devices with one of my games functions. Its a puzzle game and i assign different materials on the generated images pieces which causes the game to freeze on some devices. The first function to be called which changes the material to an outline one is this

 public void StartGame()
    {
        InterchangeRandom(shuffledArray);
        Debug.Log("shuffle");
        for (int i = 0; i < selectedArray.GetLength(0); i++)
        {
            float scaleWidth = 100 * ((float)shuffledArray(i)(2)) / ((float)selectedArray(i)(2));
            float scaleHeight = 100 * ((float)shuffledArray(i)(3)) / ((float)selectedArray(i)(3));
            spawnedGameObjects(i).transform.localScale = new Vector3(scaleWidth, scaleHeight, 0);

            // Material OutlineMaterial = Resources.Load<Material>("Solid_frame_inside_under");
            spawnedGameObjects(i).GetComponent<SpriteRenderer>().material = normal;
           //mat.material = normal;

            // Place pieces to the shuffled positions
            float halfWidth = ((float)shuffledArray(i)(2)) / ((float)2);
            float halfHeight = ((float)shuffledArray(i)(3)) / ((float)2);
            spawnedGameObjects(i).transform.position = new Vector3(shuffledArray(i)(0) - 660 + halfWidth, shuffledArray(i)(1) - 450 + halfHeight, 0);
            spawnedGameObjects(i).GetComponent<ClickOn>().MoveTo(spawnedGameObjects(i).transform.position);

            isPlaying = true;
        }

    }

The normal material is a white outline on all spawned pieces. then on each click i change it again to a red outline with an overlay and on game end i change it back to nothing using sprite default.

I have added the materials in the build settings preloaded assets but that didn’t help. i have a count down timer for game start and call that function when timer is 0 but the game stops for a couple of seconds until the materials are swaped in the game objects. Any help would be appreciated. Like if there is a way to preload all of them because this only happens in the first gameplay, once i reload the level nothing freezes anymore.

sql server – changing nvarchar (4000) to nvarchar(500)

i have a performace issue with nvarchar(4000). want to alter the table as per the query below.
my question is will it impact data or indexes. since we have over 10 million rows in the table

BEGIN  declare @length as int  
SELECT @length = MAX(LEN((SourceId))) 
from (dbo).(table) 
if   @length < 500  
begin  ALTER TABLE  (dbo).(table)   ALTER COLUMN (SourceId) NVARCHAR(500) NOT NULL;  end   
else   select ' column Length greater than 500' as tb  end

windows 10 – Raidxpert2 Removing an offline array after changing a Drive/Removing a drive (standalone drive)

I upgraded my boot drive to a larger SSD cloning it (disabling raid and using clonezilla), my raid drives are other drives and not my boot drive.

Upon entering windows now Raidxpert2 gives a critical error that the array is offline for the disk that is no longer in the system. I’ve searched and can’t find how to fix this, as most results are related to just rebuilding arrays etc.

Options in the windows application are greyed out and I can’t delete the missing array, is it something I need to do in Bios in the Raid configuration settings? I didn’t ever configure the standalone drives that way so I didn’t figure they would be visible there.

gnome – Dash to panel shape is not changing

My dash to panel is like this:
enter image description here

2 extreme ends are curved, i want it to be retangular actually, how can I do it?

I used dash to panel, and its custom config is like this:

animate-app-switch=true
animate-window-launch=true
appicon-margin=4
appicon-padding=4
available-monitors=[0]
click-action='LAUNCH'
desktop-line-use-custom-color=true
dot-color-1='#5294e2'
dot-color-2='#5294e2'
dot-color-3='#5294e2'
dot-color-4='#5294e2'
dot-color-dominant=false
dot-color-override=false
dot-color-unfocused-1='#5294e2'
dot-color-unfocused-2='#5294e2'
dot-color-unfocused-3='#5294e2'
dot-color-unfocused-4='#5294e2'
dot-color-unfocused-different=false
dot-position='RIGHT'
dot-size=3
focus-highlight=false
focus-highlight-color='#eeeeee'
focus-highlight-dominant=false
focus-highlight-opacity=25
hotkeys-overlay-combo='TEMPORARILY'
intellihide=false
intellihide-hide-from-windows=false
leftbox-padding=-1
middle-click-action='LAUNCH'
panel-element-positions='{"0":[{"element":"showAppsButton","visible":false,"position":"stackedTL"},{"element":"activitiesButton","visible":false,"position":"stackedTL"},{"element":"leftBox","visible":true,"position":"stackedTL"},{"element":"taskbar","visible":false,"position":"stackedTL"},{"element":"centerBox","visible":true,"position":"stackedBR"},{"element":"rightBox","visible":true,"position":"stackedBR"},{"element":"dateMenu","visible":true,"position":"stackedBR"},{"element":"systemMenu","visible":true,"position":"stackedBR"},{"element":"desktopButton","visible":false,"position":"stackedBR"}]}'
panel-element-positions-monitors-sync=true
panel-positions='{"0":"TOP"}'
panel-size=32
shift-click-action='MINIMIZE'
shift-middle-click-action='LAUNCH'
show-appmenu=false
show-favorites=false
show-favorites-all-monitors=false
show-running-apps=false
show-showdesktop-hover=true
show-tooltip=false
show-window-previews=false
status-icon-padding=-1
stockgs-force-hotcorner=false
stockgs-keep-dash=false
stockgs-keep-top-panel=false
stockgs-panelbtn-click-only=false
taskbar-locked=true
trans-use-custom-bg=false
trans-use-custom-gradient=false
trans-use-custom-opacity=false
trans-use-dynamic-opacity=false
tray-padding=-1
tray-size=0
window-preview-title-font-color='#dddddd'

linux – Selinux: changing root mapping

I want to control some accesses of root in Linux- fedora, for example, I want to run a process and I want root not to be able to kill it.

I use SELinux and I changed root mapping from unconfined to guest_u:

Login Name           SELinux User         MLS/MCS Range        Service

root                 guest_u              s0                   *

also, I changed my current account to root SELinux User mode. like this:

Login Name           SELinux User         MLS/MCS Range        Service

my_user              root                 s0-s0:c0.c1023       *
root                 guest_u              s0                   *

theoretically, after registering changes by rebooting, my user must have grant root privileges and the root must be unable to do many actions and activities.
but this not happened. and my root still can do everything (enabled by sudo su – from current account) and my current account can’t do what I want.

could someone explain to me what’s happened there, after I registering changes? and why I cannot reach what I want here??

thank you for any feedback!

Changing the default port without editing /etc/ssh/sshd_config

The standard way to change ports, of course, is to edit /etc/ssh/sshd_config. Since I’d really like to avoid messing with the vanilla ubuntu to the greatest extent possible,I’d prefer if it is possible to change the port by putting a Port line in, for example, ~/.ssh/config. I’ve tried doing this, but to no avail. I’ve also tried putting a customized copy of sshd_config in that directory, which also didn’t work. Can anybody suggest some way to change ports without touching any files owned by root?

Thanks!

backup – Oracle Linux 6.10 – Changing the Oracle user’s ID & GID

OS: Oracle Linux 6.10

DB vers: 12cR1

I will backup and restore from NFS shared disk for a preprod server. However, the ID and GID of the oracle user on the production server (shared disk on producution) are different from the preprod server. For this reason, I need to change the ID and GID information, otherwise I cannot see the backup files on the preprod server. However, when I do this, there will be a problem on the datafile, oracle home and other existing ownerships on the preprod server. How can I perform this operation with the least amount of problems? It’s fine as long as the downtime isn’t taking too long on the preprod server.