Category: Computers

  • Compose key for Windows

    Github link: https://github.com/SamHocevar/wincompose

    Examples

    Compose rules are supposed to be intuitive. Here are some examples:

    • ⎄ Compose ` aà
    • ⎄ Compose ' eé
    • ⎄ Compose ^ iî
    • ⎄ Compose ~ nñ
    • ⎄ Compose / oø
    • ⎄ Compose " uü
    • ⎄ Compose o c©
    • ⎄ Compose + -±
    • ⎄ Compose : -÷
    • ⎄ Compose ( 7 )
    • ⎄ Compose C C C P
    • ⎄ Compose < 3

    Emoji sequences typically start with two ⎄ Compose hits:

    • ⎄ Compose ⎄ Compose a n g r yangry
    • ⎄ Compose Compose g r i n n i n ggrin
    • ⎄ Compose ⎄ Compose s u s h isushi
    • ⎄ Compose ⎄ Compose s n a k esnake

    A special Unicode input mode can be activated in the options and lets the user type in any Unicode character:

    • ⎄ Compose u 5 8 d Enter → ֍ (U+058D Right-Facing Armenian Eternity Sign)
    • ⎄ Compose u 2 3 f 0 Enteralarm_clock (U+23F0 Alarm Clock)

    The full list of rules can be found by clicking on the WinCompose system tray icon or using the “Show Sequences…” menu entry:

  • Algebra Love

    https://www.desmos.com/calculator/yoq5tfkhsa

    f\left(x\right)=x^{\frac{2}{3}}+0.9\left(3.3-x^2\right)^{\frac{1}{2}}\cdot\sin\left(a\cdot\pi\cdot x\right)

  • ISPConfig Regex Blacklist

    1. Log into ISPConfig
    2. Go to Email tab
    3. On the left on Global Filters select the “Content Filter”
    4. Press on “Add new Content Filter”
    5. Make sure that it uses “Header Filter”
    6. In the Regexp Pattern input enter for example:

    /<.+?@.+?\.xyz>/

    7. In the Data input box you can enter some message. I use like: “No .xyz mail allowed here”
    8. For the Action use “Reject” or “Discard”
    9. Save

    Credit: Sjau

  • ddrescue

    From:

    https://www.data-medics.com/forum/how-to-clone-a-hard-drive-with-bad-sectors-using-ddrescue-t133.html

    ddrescue -f -R /dev/sdb /dev/sda /home/it/Desktop/ddrescuelog.log

  • OpenVPN Ubuntu – add import ovpn file ability

    Use network-manager-openvpn-gnome instead of network-manager-openvpn to get the option to import the VPN configuration files.

    sudo apt install openvpn
    sudo apt install network-manager-openvpn-gnome

     

  • Merge Documents macro inserting section break (Word)

    Sub MergeMultipleFiles()
    Dim fDialog As FileDialog
    
    Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
    With fDialog
    .AllowMultiSelect = True
    .InitialView = msoFileDialogViewList
    If .Show <> -1 Then
    MsgBox "Cancelled By User", , "Cancelled"
    Exit Sub
    End If
    End With
    For i = 1 To fDialog.SelectedItems.Count
    Selection.InsertFile fDialog.SelectedItems.Item(i)
    Selection.InsertBreak Type:=wdSectionBreakNextPage
    
    Next i
    End Sub

  • Nextcloud and Collabra on Ubuntu (access denied)

    Credit here to Speedysurf HERE: https://help.nextcloud.com/t/nc-11-0-3-and-collabora-access-denied/12221/2

    first get the current ExecStart form your docker.service file:
    
        grep ExecStart /lib/systemd/system/docker.service
        the result is something like this:
        ExecStart=/usr/bin/dockerd -H fd://
    
    now use this result to create a systemd docker drop-in configuration file. Create the service directory first therefore as well:
    
        mkdir /etc/systemd/system/docker.service.d
        editor /etc/systemd/system/docker.service.d/execWithDeviceMapper.conf
    
    The file now must contain the following lines:
    
        [Service]
        ExecStart=
        ExecStart=/usr/bin/dockerd --storage-driver=devicemapper -H fd://
    
    remove your old container (shamelessly stolen from @Andreas_Fuchs's post below :wink: )
    
        docker ps (to get the id)
        docker stop [id]
        docker rm [id]
    
    restart systemd, docker and your container
    
        systemctl daemon-reload
        systemctl restart docker.service
        docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=CLOUD.DOMAIN.TLD' --restart always --cap-add MKNOD collabora/code

  • Word Autosave 1

    Credit to datanumen.com

    Save reminder will prompt user to name new documents when a blank doc is open, if refused will show number of open unsaved documents. Autosaves named documents every 5 min.

    Alt F11 in Word to open the VBA editor, click “Normal” to select the Normal template, and hit Insert –> Module to create a new module.  Paste the following code in the new module and save it.

    Sub AutoNew()
      Dim objDoc As Document
      Dim strButtonValue As String
      Dim dtAskingTime As Date
     
      '  Initialization
      Set objDoc = ActiveDocument
      '  Set the asking time in 5 minutes.
      dtAskingTime = Now + TimeValue("00:05:00")
     
      If objDoc.Path <> "" Then
        Exit Sub
      Else
        strButtonValue = MsgBox("This document has not been saved yet." & vbCr & "Do you want to save the file?", vbYesNo)
        If strButtonValue = vbYes Then
          Dialogs(wdDialogFileSaveAs).Show
          '  In case you click Cancel button, the macro continue running and prompting message in every 5 minutes.
          If objDoc.Path = "" Then
            Application.OnTime When:=dtAskingTime, Name:="AutoNew"
          End If
        Else
          Application.OnTime When:=dtAskingTime, Name:="AutoNew"
        End If
      End If
      Call CountUnsavedDoc
    End Sub
    
    Sub CountUnsavedDoc()
      Dim objDoc As Document
      Dim nDocUnsaved As Integer
     
      nDocUnsaved = 0
    
      For Each objDoc In Documents
        If objDoc.Path = "" Then
          nDocUnsaved = nDocUnsaved + 1
        End If
      Next objDoc
      nDocUnsaved = MsgBox(nDocUnsaved, 0, "Number of unsaved document")
    End Sub

  • Enable vacation OOO Zentyal 5 – SOGo

    To enable the Out of Office (Vacation) tab in SOGo perform the following actions:
    NOTE: I am told this will overwrite any sieve mail filter already set (unverified)

     

    sudo mkdir /etc/zentyal/stubs/sogo
    sudo cp /usr/share/zentyal/stubs/sogo/sogo.conf.mas /etc/zentyal/stubs/sogo/sogo.conf.mas
    sudo nano /etc/zentyal/stubs/sogo/sogo.conf.mas
    CTRL w to open "find" and search for:
    Vacation (Line should read, "SOGoVacationEnabled = No;"
    Change No; to Yes;
    CTRL o to save
    CTRL x to exit
    Restart SOGo from the web interface

  • GIMP outline text (or anything)

    Layer menu -> Transparency -> Alpha to selection
    Edit menu -> stroke selection.

  • linux cli what is my ip

    wget http://ipinfo.io/ip -qO -

  • How To Change The Zentyal Certificate Algorithm From SHA-1 To SHA256

    As of Zentyal version 4.2 the bundled certificate authority (CA) module is creating signed certificates using the SHA-1 algorithm which is an old algorithm and pretty much deprecated.

    Google Chrome, for example, will give a warning when accessing any SSL page that’s encrypted stating that your connection is not secure.

    SSL Certificates created now should, as a minimum, use the the SHA256 algorithm to ensure encrypted connections are kept private. To change Zentyal to use the SHA256 algorithm, you’ll need to make a small edit to your openssl.cnf file.

    default_md = sha1

    Edit the value and enter sha256.

    default_md = sha256

    You’ll then need to log into the Zentyal Admin site and revoke and re-issue all of your sha1 certificates.

    Credit: James Coyle

  • server base clone

    Start by creating a new guest volume (virt-manager) for the target of the desired size

    
    sudo virt-resize --expand /dev/sda1 16.04-server-base <NEWVOLUME>.qcow2

    The above will expand the /dev/sda1 partition on the base image into the new volume

     

    http://libguestfs.org/virt-resize.1.html

  • pcmanfm with network from cli

    dbus-launch pcmanfm

  • Ceton Linux prob 3.16.0-48+ kernel fix

    Problem with 3.16.0-48-generic. I did this and rebooted and it worked:
    
    Code: Select all
        dkms remove -m ctn91xx -v 2013_0326_2226 --all
        dkms add -m ctn91xx -v 2013_0326_2226
        dkms build -m ctn91xx -v 2013_0326_2226
        dkms install -m ctn91xx -v 2013_0326_2226
    
    

    https://ubuntuforums.org/showthread.php?t=2291607&p=13350770#post13350770