Pressing SysReq key (alone or with other keys) takes me back to X session

Summary:

When I switch to a tty, if I press SysRq and release, I’m taken back to my X session.

When I try any “Magic SysRq” commands other than Alt + SysRq + space or Alt + SysRq + p, no “magic” happens and I’m just taken back to my X session.

Both Alt + SysRq + space and Alt + SysRq + p print a help/usage message.

Background:

I’m running Ubuntu 18.04, kernel version 4.15.0-58-generic (package version 4.15.0-58.64) on x86_64. My laptop is a Thinkpad 13 (2016 model), and the SysRq key is Fn+S.

I’ve set the kernel sysrq mask to 1 (it was originally the default 176), but that didn’t change the behaviour at all:

$   sysctl kernel.sysrq kernel.sysrq = 176  $   sudo sysctl kernel.sysrq=1 kernel.sysrq = 1  $   sysctl kernel.sysrq kernel.sysrq = 1 

Magic SysRq is enabled in the kernel:

$   grep MAGIC_SYSRQ /boot/config-$  (uname -r) CONFIG_MAGIC_SYSRQ=y CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x01b6 CONFIG_MAGIC_SYSRQ_SERIAL=y 

What I’ve tried:

If I press and hold Alt + Fn+S and then press Space (while still holding down Alt + Fn+S), I get the SysRq help/usage message:

[  294.516753] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)  

which suggests that Fn+S is indeed acting as SysRq.

If I try any other “Magic SysRq” key combinations, it’s equivalent to if I just press Fn+S by itself – I’m immediately taken back to my X session.

I’ve tried the following keys (as they seem largely harmless):

  • d Shows all locks that are held.
  • l Shows a stack backtrace for all active CPUs.
  • m Will dump current memory info to your console.
  • p Will dump the current registers and flags to your console.
  • t Will dump a list of current tasks and their information to your console.
  • w Dumps tasks that are in uninterruptible (blocked) state.
  • r Turns off keyboard raw mode and sets it to XLATE.

Of those, Alt + SysRrq + p also printed the same help information as Alt + SysRq + Space; the others just took me back to my X session.

Can I rely on Google id_token for web session?

I’m building a website without a “server”: JavaScript and AWS Lambdas as back-end through API Gateway.

Knowing there is no solution for session when using lambdas, I was wondering if I could only use the id_token provided by the Google JavaScript library to authenticate a user?

The idea is to pass the token for each request to the back-end and make a request to Google to know if the token is legit.

Does this sound like a secure solution?

Ubuntu terminal ssh and use session to auto create tabs and open defined log files

I have created a keyboard shortcut that initiates an SSH session to my server which works as expected and there is no issue with that.

However, to enable faster access to multiple log files I have resorted to opening multiple terminals with the same command, this means several terminals each with its own ssh session.

What would like to happen is to have just one terminal/ssh session and open each log file under a separate tab.

How would you approach this?

The current keyboard shortcut I use is:

gnome-terminal -x ssh server1r 

Where server1r is a just a predefined ssh configuration in ~/.ssh/config

Kali Linux : Failed to open session for virtual machine is failed on Windows 10 [on hold]

I installed Virtual Box 6.0 in Windows 10 OS and then downloaded 64 bit ova file for Kali Linux. I created NAT network for communication between host and guest operating system.

When starting Kali Linux getting following error:

Some Kali Linux error

Note : Virtualization is enabled and Hyperv is disabled for Windows 10.

How to solve this error?

Get Last Added Product ID of Cart without using checkout session

I am using RESTful APIs of Magento and I want to get the last added product id of in the cart. All of my searches are using the Checkout Session method of Magento which is

$ this->checkoutSession->getLastAddedProductId();

But this is not applicable on my end since I am using the RESTful APIs. Can someone help me if there are any available functionality where I can put a one liner method and class to get this with Quote. My other solution is to fetch by Quote :: getAllVisibleItems() and get the last item’s product id but I believe it would affect the performance.

Thank you for your help folks.

My session automatically closes when starting a certain type of app

New to Ubuntu here XD Ok so I just did an install of ubuntu alongside windows. Everything works perfectly except one thing: Ubuntu crashes. It’s not constant tho, and it happens when I open settings, or when i wanna change the back ground via the right click on the desktop, or when i want to play a song. I tried the alt+Sys Req + REISUB thing but it logged me off again on the next session while clicking on a song to make it play. These are the type of action I did when it logged me off, I haven’t tried othe ways to make me log off.

Sistema de visualização com session com erro

Fala ai galera, bom eu tava fazendo esse sistema de visualização para um fórum que estou desenvolvendo, e acabou que eu emcontrei um problema…

Fiz ele utilizando Sessions, porém a cada atualizada na página, conta +1 view no bd. Como posso corrigir isso sem que aconteça bugs na hora do usuário acessar outros posts?

<?php  session_start(); try{     // CONEXAO AO BANCO DE DADOS EM PDO     $  pdo = new PDO("mysql:host=localhost;dbname=testerede", "root", ""); }catch(PDOException $  e){     // RETORNA O ERRO SE HOUVER UM     echo $  e->getMessage(); }   $  _SESSION['view'] = 1;  if (isset($  _SESSION['view'])) {     $  d = date('Y-m-d');     $  sql = $  pdo->prepare("INSERT INTO views (id_views,id_user,id_post,data 

) VALUES (NULL, ‘1’, ‘1’, ‘$ d’);”); $ sql->execute(); }else{ echo “erro”; } ?>

tmux – Will session kill if not detached

The question I know is basic, but could not find an exact matching question in community.
The standard process of using tmux is – create a session, run command within and then detach the session. So existing ssh terminal will not kill our process.

My question is, if tmux session is created and a long command is running within it. But before detaching, if ssh session terminates, then will this tmux session persist or it will be killed too?