notes

yumex-dnf is locked

Permalink 1 minute read Modified: (rhnvrm)

I downloaded a .rpm and double clicked it to install it and it started yumex-dnf. But for some reason it crashed and dnf was locked. I fixed it using yumex-dnf --exit and installed the rpm using sudo dnf install cacher-1.1.10.x86_64.rpm

Adding xfce4 Keyboard Shortcuts for Clementine or Spotify

Permalink 1 minute read Modified: (rhnvrm)

xfce4 has default media key settings for Pragha music player. Although, if you use clementine music player you can use keyboard shortcuts to control it with DBus and MPRIS. Clementine is known as org.mpris.clementine and you can add the following entries to your Keyboard Settings > Application Shortcuts If you use spotify, it is registered as org.mpris.MediaPlayer2.spotify on qdbus. qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Next qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Pause qdbus org.mpris.clementine /Player org.

Checking if a number is prime using Regex

Permalink 1 minute read Modified: (rhnvrm)

def is_prime(n): return not re.match(r'^.?$|^(..+?)\1+$', '1'*n) This works by first converting the number to unary, i.e. 5 will be ‘11111’ and 3 will be ‘111’ and so on. First, it tries to match 0 or 1 in the LHS and then uses backreferences to try and match multiples of 2, 3, 4 and so on until a match is found or string length is exceeded. For a deeper analysis please read: https://iluxonchik.

Notes on Regex

Permalink 2 minute read Modified: (rhnvrm)

I’m going to use python. Regex can be used by using the re library. You should not refer to this post as these are just notes, it would be better to follow the actual documentation of the library. To use regex, which uses backslashes \ we must use raw python strings like r"\n". . matches anything but a newline \d matches 0-9 while \D matches anything but digits. Similarly, \w matches word chars.

Share WiFi via Ethernet on Gnome 3.20

Permalink 1 minute read Modified: (rhnvrm)

There is a hidden method to share your WiFi over Ethernet in the latest Gnome. I stumbled upon this while trying to connect my RaspberryPi 3B with my University’s Internet. Type nm-connection-editor in your terminal. Add a shared network connection by pressing the Add button. Choose Ethernet from the list and press Create. Click IPv4 Settings in the left. Choose Shared to other computers by clicking the Method drop-down menu.

Serverside and Clientside Redirection

Permalink 3 minute read Modified: (rhnvrm)

Redirection can be achieved Server-Side or Client-Side. Redirection on client side involves the following steps: User requests a Page using an URI. Server sends a page based on that. That page will have JavaScript that will redirect user to another page. So, again server will get the request for the new page and then server will give response based on new request. That implies: Client-side -> Server-side -> Client-side -> Server-side -> Client-side.

Some Cool Javascripts

Permalink 2 minute read Modified: (rhnvrm)

I have collected some nice java-scripts that are really useful, Just copy and paste them in your browser’s address bar:- This code lets you edit any page/website in real-time. With Firefox, you can even edit and save the modified pages to your computer. This is a really cool script, very useful! javascript:document.body.contentEditable='true'; document.designMode='on'; void 0 There are times when you are not sure that the website that you are visiting is authentic.