Skip to content

Commit

Permalink
new stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
kaaninho committed Jan 29, 2021
1 parent ee4c950 commit a9280da
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 1 deletion.
67 changes: 67 additions & 0 deletions fixed-columns-table.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
* In reacl fixed columns
Zeichne zweimal dieselbe Tabelle, eine mit Style-Attribut =position= als
=absolute=. Verstecke dort alle Spalten, die nicht fix sein sollen, setze deren
=visibility= auf =hidden=.

** Code-Beispiel
Hier war zu beachten, dass =table-responsive= das Attribut =overflow-x=
überschrieben hatte.

#+begin_src clojure
modified src/main/clojure/src/webclient/verwaltung/workflows.cljs
(reacl2/defclass table-with-fixed-columns this state [local-state options]
;; This class is needed for having a table with fixed columns.
;; We draw the table 2 times, one table only shows the fixed columns.
;; That table has `position` `absolute` as style. We set this in the
;; CSS file via the id `first-columns-table`.
;; To hide the other columns (which should scroll), we use the code
;; of `component-did-update`.
component-did-mount
(fn []
(let [comp (js/$ "#first-columns-table")
table (.find comp "table")
trs (.find table "tr")
td-fun (fn []
(this-as my-this
(.attr (js/$ my-this) "style" "background-color:black; visibility:hidden")))]

(.each (.find trs "td:not(:first-child, :nth(1))")
td-fun)
(.each (.find trs "th:not(:first-child, :nth(1))")
td-fun)
(reacl2/return)))

render
(let [the-table-fn (fn [& [id]]
(dom/div
(when id
{:id "first-columns-table"})
(utils/create-table-with-border
(surveys-header (insert-archive-phase (lens/yank state workflow-archive-phase-lens) (lens/yank state workflow-phases-lens)))
nil
(when-not (nil? (:selected-tab local-state))
(remove #(or (optional-task? %)
(external-link? %))
(surveys-and-tasks-for-group (:selected-tab local-state) state)))
(partial surveys-entry-fn
this
(:selected-surveys local-state)
(insert-archive-phase (lens/yank state workflow-archive-phase-lens) (lens/yank state workflow-phases-lens))
(= :anamnese (:selected-tab local-state))
(lens/yank state workflow-repeated-phase-lens))
options
:table-color "#2da2e4")))]
(dom/div
{:id "double-table"
:style {:position "relative"}}
(the-table-fn true)
(the-table-fn))))
#+end_src

#+begin_src css
#first-columns-table .table-responsive {
overflow-x : hidden !important;
position: absolute;
width:100%;
}
#+end_src
116 changes: 115 additions & 1 deletion linux-stuff.org
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Das obige auch ausführen (modprobe...) falls mal irgendwie =i8kfan= / =i8kmon=
*** i8k Benutzung
https://medium.com/@kasunsiyambalapitiya/fixing-constantly-running-fans-on-dell-laptops-running-ubuntu-16-04-8cf6595381d9


** dell-bios-fan-control

i8k wird leider von den Bios-Einstellungen überschrieben, deshalb explizit Bios
Expand Down Expand Up @@ -391,3 +390,118 @@ und den Wert auf =true= setzen
** dtrx

Versucht, gg. Datei zu extrahieren, egal welches Format

* Memory-Management
mit =free -m= Memory-Usage anschauen. "available" ist der wichtige und richtige
Wert. Ist RAM zu voll, wird teilweise geswappt. Swapping macht PC langsam und
warm (so meine Erfahrung). Deshalb kann man Swapping-Verhalten anpassen:
** Swap
*** Swap leeren
Wenn was im Swap Speicher ist, obwohl man genug RAM hätte, kann man mit
folgenden Befehlen den Swap kurzzeitig aus- und anschalten. Die Swap-Inhalte
werden vor dem Ausschalten in den RAM gepumpt.

#+begin_src bash
sudo swapoff -a
sudo swapon -a
#+end_src

*** Swappiness
Man kann einstellen, wie zügig der Swap-Speicher benutzt werden soll.

#+begin_src bash
# Zeige aktuelle Swappiness (default Ubuntu ist 60)
cat /proc/sys/vm/swappiness
# Setze Swappiness
sudo sysctl vm.swappiness=10
#+end_src

Geringerer Wert = weniger schnell zum Swap-Speicher greifen. Nach Neustart
wieder auf default. Um es permanent zu schalten, muss der Datei
=/etc/sysctl.conf= folgendes hinzugefügt werden: =vm.swappiness=10=

Quelle(n)
https://www.howtoforge.com/tutorial/linux-swappiness/
https://www.howtogeek.com/449691/what-is-swapiness-on-linux-and-how-to-change-it/

* Boot-Screen ändern
Von hier https://www.gnome-look.org/p/1339324/ Bootscreen auswählen.

** Schöne Screens
- ubuntu touch
https://www.gnome-look.org/p/1339324/
- ubuntu vision
https://www.gnome-look.org/p/1359645/
- lilith-glamour
https://www.gnome-look.org/p/1351775/

** Installation

Am Beispiel ubuntu-vision. mit =plymouth-x11= kann man eine Vorschau sehen.

#+begin_src bash
sudo mkdir /usr/share/plymouth/themes/ubuntu-vision
clear
sudo rsync -aq --exclude=install-ubuntu-vision * /usr/share/plymouth/themes/ubuntu-vision/
clear
sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/ubuntu-vision/ubuntu-vision.plymouth 100
sudo update-alternatives --config default.plymouth #here, choose the number of the theme you want to use then hit enter
sudo update-initramfs -u
echo
echo Installing plymouth-x11... Redundant if already installed.
sudo apt-get install plymouth-x11
echo
echo Running 10-second test...
sudo plymouthd ; sudo plymouth --show-splash ; for ((I=0; I<10; I++)); do sleep 1 ; sudo plymouth --update=test$I ; done ; sudo plymouth --quit
exit
#+end_src

ausführen

* Login-Screen ändern
https://askubuntu.com/questions/797845/how-do-i-change-the-login-screen-in-ubuntu-16-04#:~:text=In%20short%3A%20Open%20sudo%20gedit,restart%20to%20try%20it%20out.
* Desktop gnome Theme ändern
** Schöne Themes
- https://www.gnome-look.org/p/1334194/
- https://www.gnome-look.org/p/1357889/
- oder allgmein auf https://www.gnome-look.org/ oder https://pling.com schauen

** Installation
- Themes werden in den Ordner =/home/kaan/.themes= entpackt
- Icon-Packages in =/home/kaan/.icons=

Dann kann man mit dem Gnome Tweaks Tool unter "Appearance" die gewünschten
Themes und Icon-Packages auswählen

* Nur bestimmten Monitor sharen
https://github.com/Ashark/hliss
* Bildschirm aufnehmen, Screen Capture
** Kazam
Kann sogar nur Teile des Bildschirms aufnehmen, easy usage
#+begin_src bash
sudo apt install kazam
#+end_src
* Login Fail, Unlock GUI from console
Falls man sich mal grafisch nicht mehr einloggen kann, folgender Befehl in einer
Konsole unlockt Sessions:

#+begin_src bash
sudo loginctl unlock-sessions
#+end_src

(War bei mir der Fall nach nem Update. Kam beim GUI-Login "Authentication
Error". Anscheinend, weil fs.inotify.max_user_watches auf einen sehr niedrigen
Wert gesetzt war. Schreibe in =/etc/sysctl.conf= rein:

#+begin_src bash
fs.inotify.max_user_watches=524288
#+end_src

und es sollte wieder funktionieren.)
* CAPS LOCK als ESCAPE
Tweaks -> Keyboard & Mouse -> Additional Layout Options -> Caps Lock behavior ->
Make Caps Lock an additional Esc

Es kann sein, dass es mal für externe Tastatur nicht funktioniert. Dann
deaktivieren, Tweaks schließen, wieder starten und aktivieren.
* gnome-shell-extensions
50 changes: 50 additions & 0 deletions make-record.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(defun un-camelcase-string (s &optional sep start)
"Convert CamelCase string S to lower case with word separator SEP.
Default for SEP is a hyphen \"-\".
If third argument START is non-nil, convert words after that
index in STRING."
(let ((case-fold-search nil))
(while (string-match "[A-Z]" s (or start 1))
(setq s (replace-match (concat (or sep "-")
(downcase (match-string 0 s)))
t nil s)))
(downcase s)))


(defun field->field-tuple (field name)
(list field
" "
(concat name "-" field)
"\n "))

(defun create-field-tuples (fields name)
(let* ((field-tuples (mapcar (lambda (field)
(field->field-tuple field name))
fields))
(last-tuple (butlast (car (last field-tuples))))
(field-tuples2 (append (butlast field-tuples)
(list last-tuple))))
(apply #'concat (append '("[")
(apply #'append field-tuples2)
'("]")))))

(defun create-constructor (name)
(concat "make-" name))

(defun create-predicate (name)
(concat name "?"))

(defun make-record ()
(interactive)
(let* ((type-name (read-string "type-name: "))
(name (un-camelcase-string type-name))v
(fields (split-string (read-string "fields: ") " "))
(field-tuples (create-field-tuples fields name)))
(insert (concat "(define-record-type " type-name
"\n "
(create-constructor name)
"\n "
(create-predicate name)
"\n "
field-tuples ")"))))

0 comments on commit a9280da

Please sign in to comment.