Enter your OpenVPN config:
nano /etc/openvpn/server.conf
and add the following line with the local IP of your Pi-hole:
push "dhcp-option DNS 192.168.X.X"
Enter your OpenVPN config:
nano /etc/openvpn/server.conf
and add the following line with the local IP of your Pi-hole:
push "dhcp-option DNS 192.168.X.X"
Append the following two lines to the lxc config file on your Proxmox host.
You’ll find the config here: /etc/pve/lxc/container_name.conf
Got this info from here and it works fine.
lxc.cgroup.devices.allow: c 10:200 rwm
lxc.hook.autodev: sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"
There is just one line necessary for the openVPN installation.
wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh
If you want to add another profile, just run the installer again:
bash openvpn-install.sh
Find related example reports in package SBCOMS.
TRY.
DATA(lo_sender) = cl_sapuser_bcs=>create( sy-uname ).
DATA(lo_recipient) = cl_cam_address_bcs=>create_internet_address( i_address_string = lv_mailaddress ).
DATA(lv_html_text) = |<BODY> | &&
|<p>Guten Tag,<br>| &&
|<br>| &&
|Es ist ein Fehler aufgetreten.<br>| &&
|Bitte schauen Sie in das Application Log.<br>| &&
|<br>| &&
|Vielen Dank!</p>| &&
|</BODY>|.
DATA(lo_document) = cl_document_bcs=>create_document( i_type = 'HTM'
i_text = cl_document_bcs=>string_to_soli( ip_string = lv_html_text )
i_subject = |Fehler| ).
" Erzeuge Business Communication Service und setze Objekte
DATA(lo_send_request) = cl_bcs=>create_persistent( ).
lo_send_request->set_sender( lo_sender ). " Sender
lo_send_request->add_recipient( lo_recipient ). " Empfänger
lo_send_request->set_document( lo_document ). " Mailtext
lo_send_request->set_send_immediately( abap_true ). " Mail sofort senden
lo_send_request->send( ). " Sende Mail!
COMMIT WORK. " Ohne Commit wird keine Mail in der SOST auftauchen
" Schreibe Fehler in das Log
CATCH cx_address_bcs INTO DATA(lx_address_bsc).
mr_log->add_exception( i_exception = lx_address_bsc ).
CATCH cx_send_req_bcs INTO DATA(lx_send_req_bcs).
mr_log->add_exception( i_exception = lx_send_req_bcs ).
CATCH cx_document_bcs INTO DATA(lx_document_bcs).
mr_log->add_exception( i_exception = lx_document_bcs ).
ENDTRY.
cl_demo_output=>new( )->write_data( lt_display_data )->display( ).
*or
cl_demo_output=>display( lt_display_data ).
DATA(lr_log) = NEW cl_bal_logobj( i_log_object = 'ZMM'
i_default_subobject = 'ZMM_LOGGING' ).
lr_log->add_statustext( i_statustext = |Write a text.| ).
lr_log->add_exception( lo_excp ).
lr_log->add_errortext( lo_excp->get_longtext( ) ).
lr_log->add_msg( i_probclass = '1' ). "will use sy-msgty sy-msgid sy-msgno sy-msgv1 ...
lr_log->save( i_client = sy-mandt ).
lr_log->display( ).
Note: When using on EHP 7.40 you will get some confusing & &
around your message texts.
https://tricktresor.de/blog/ausnahmen-mit-t100-nachricht-abap750/
Possible values for i_probclass:
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(alv_table)
CHANGING t_table = lt_display_data ).
alv_table->display( ).
CATCH cx_salv_msg.
ENDTRY.
METHOD operate_it.
DATA ls_return TYPE bapireturn1.
DATA key TYPE bapipakey.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = is_2002-pernr
IMPORTING
return = ls_return.
IF ls_return IS NOT INITIAL.
RAISE EXCEPTION TYPE zcx_xxx MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '2002'
number = is_2002-pernr
subtype = is_2002-subty
objectid = is_2002-objps
lockindicator = is_2002-sprps
validityend = is_2002-endda
validitybegin = is_2002-begda
recordnumber = is_2002-seqnr
record = is_2002_chg
operation = iv_actio "MOD,INS,DEL
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = ls_return
key = key.
IF ls_return IS NOT INITIAL.
RAISE EXCEPTION TYPE zcx_xxx MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = is_2002-pernr.
ENDMETHOD.
How to handle BAPI_ACC_DOCUMENT_POST with a document split at position 980. The method create_document
fills the necessary tables and calls post_document
, if it reaches position 980, to post the current document. Then the method create_document
calls itself recursive for the next positions.
METHOD create_document.
DATA: lt_pos TYPE TABLE OF bapiacgl09,
lt_pos_amt TYPE TABLE OF bapiaccr09.
gr_listlog->append_log_entry( iv_type = gr_listlog->gc_log_type_info
iv_text = |Beginne Belegerstellung|
iv_alog = abap_true ).
"Belegkopf
DATA(ls_documentheader) = VALUE bapiache09( comp_code = gs_sel-p_bukrs
header_txt = |header text|
pstng_date = sy-datum
doc_date = sy-datum
fisc_year = sy-datum(4)
fis_period = sy-datum+4(2)
doc_type = gs_sel-p_blart
username = sy-uname ).
"Fülle Positionen
LOOP AT it_xxx ASSIGNING FIELD-SYMBOL(<ls_xxx>).
APPEND VALUE #( itemno_acc = lines( lt_pos ) + 1
gl_account = <ls_xxx>-hkont
stat_con = abap_false
acct_type = 'S' "Sachkonto
bus_area = '0030'
fis_period = sy-datum+4(2)
fisc_year = sy-datum(4)
pstng_date = sy-datum
value_date = sy-datum
item_text = |item text|
alloc_nmbr = <ls_xxx>-zuonr
doc_type = <ls_xxx>-blart
comp_code = <ls_xxx>-bukrs
func_area = '0030'
costcenter = <ls_xxx>-kostl
tax_code = <ls_xxx>-mwskz ) TO lt_pos.
APPEND VALUE #( itemno_acc = lines( lt_pos_amt ) + 1
curr_type = '00' "Belegwährung
currency = |EUR|
amt_doccur = <ls_xxx>-betrg ) TO lt_pos_amt.
"Belegsplit notwendig?
IF lines( lt_pos ) = 980.
gr_listlog->append_log_entry( iv_type = gr_listlog->gc_log_type_statistic
iv_text = |Belegsplit notwendig!|
iv_alog = abap_true ).
"Verbuche die aktuellen Positionen
post_document( is_documentheader = ls_documentheader
it_pos = lt_pos
it_pos_amt = lt_pos_amt ).
"Rekursiver Aufruf der Methode! Nur mit den Sätzen die noch nicht verarbeitet wurden
create_document( it_xxx = FILTER #( it_xxx USING KEY sort_key WHERE xxx = xxx ) ).
"Verlasse bei Rekursion hier
RETURN.
ENDIF.
ENDLOOP.
"Wenn alle Positionen hinzugefügt, lege den Beleg an
post_document( is_documentheader = ls_documentheader
it_pos = lt_pos
it_pos_amt = lt_pos_amt ).
ENDMETHOD.
Calling the BAPI:
METHOD post_document.
DATA lt_return TYPE STANDARD TABLE OF bapiret2.
IF gs_sel-p_test = abap_true.
gr_listlog->append_log_entry( iv_type = gr_listlog->gc_log_type_info
iv_text = |Testlauf: Keine Belegbuchung|
iv_alog = abap_true ).
RETURN. "Im Testlauf hier verlassen
ENDIF.
SET UPDATE TASK LOCAL.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader = is_documentheader
TABLES
accountgl = it_pos
currencyamount = it_pos_amt
return = lt_return.
"Protokollzeilen mit BAPI Meldungen hinzufügen
LOOP AT lt_return ASSIGNING FIELD-SYMBOL(<ls_return>).
gr_listlog->append_log_entry( iv_type = <ls_return>-type
iv_text = CONV #( <ls_return>-message )
iv_alog = abap_true ).
ENDLOOP.
"Prüfen, ob eine Fehlermeldung vorliegt
IF line_exists( lt_return[ type = 'A' ] ) OR line_exists( lt_return[ type = 'E' ] ).
"Rollback
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
"Alles gut -> commit
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
"Protokollzeile mit der Erzeugten Belegnummer nochmal explizit ins Log
DATA(lv_documentnumber) = lt_return[ 1 ]-message_v2(10). "hier steht laut Doku die Belegnummer drin
gr_listlog->append_log_entry( iv_type = gr_listlog->gc_log_type_success
iv_text = |Belegnummer: { lv_documentnumber }|
iv_alog = abap_true ).
ENDIF.
ENDMETHOD.
1. Install neofetch.
sudo apt install neofetch
2. Install lolcat.
# When installing with "apt install lolcat", you will get version: lolcat 42.0.99
# To get the current version use:
sudo apt remove lolcat -y
wget https://github.com/busyloop/lolcat/archive/master.zip
unzip master.zip
rm master.zip
cd lolcat-master/bin
sudo gem install lolcat
3. Append the following line at the end of your ~/.bashrc (or at the beginning, if you are using zsh: ~/.zshrc) file, to get the neofetch output on every terminal run.
neofetch | lolcat
If you want to change the config of neofetch, you’ll find it here:
~/.config/neofetch/config.conf
How to replace a specific pattern in a file or folder name. In my case I needed to correct the season on each file of a series from “S08” to “S09”:
for f in *; do mv "$f" "$(echo "$f" | sed s/S08/S09/)"; done
If you want to replace a pattern recursive, use the command “find”:
find . -name '*' -exec bash -c 'echo mv $0 ${0/S08/S09}' {} \; // with echo for testrun