Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@laksjdjf
laksjdjf / chat.py
Created April 23, 2024 11:17
command -r専用
import gradio as gr
import json
import requests
import argparse
def get_prompt(system, message, history):
prompt = f"<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{system}<|END_OF_TURN_TOKEN|>"
for mes, res in history:
prompt += f"<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{mes}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>{res}<|END_OF_TURN_TOKEN|>"
prompt += f"<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{message}<|END_OF_TURN_TOKEN|><|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>"
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 17, 2024 07:01
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active April 23, 2024 12:18
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London

@W1R3D-Code
W1R3D-Code / sonarqube.service
Last active April 23, 2024 12:16
Running SonarQube as a Service on Linux with SystemD - /etc/systemd/system/sonarqube.service
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonarqube/bin/linux-x86-64/sonar.sh stop
@kazimolmez
kazimolmez / Fix Linux NTFS disk read-only problem
Created March 28, 2018 09:02
Fix Linux NTFS disk read-only problem
$ sudo mount -o remount,rw /windows
@anujmiddha
anujmiddha / gist:7b0d80a6ba141e29d61f
Created January 25, 2015 09:14
dokku database reset instructions
dokku postgresql:delete db-name
dokku postgresql:create db-name
dokku postgresql:link app-name db-name
dokku run app-name rake db:migrate
@finalfantasia
finalfantasia / improving_text_antialiasing_and_gui_performance_in_intellij_idea_on_openjdk_8.md
Last active April 23, 2024 12:11
Improving Text Anti-aliasing and GUI Performance in IntelliJ IDEA on OpenJDK 8

This is a list of tweaks to make IntelliJ IDEA work better with OpenJDK 8. Refer to System Properties for Java 2D Technology for the details of the options used below.

Note that the performance boost achieved via the OpenGL-based hardware acceleration pipeline is made possible by using the open-source Radeon driver (for AMD graphics cards) included in the latest stable version (10.3.3 as of now) of the Mesa 3D Graphics Library available in the official Fedora 21 stable repository. Therefore, the gained performance boost might vary based on the types of graphics cards and the versions of the drivers used in your system.

  1. Fixing Text Anti-aliasing in Fedora (Ubuntu users may skip this step.)
  2. Fixing text anti-aliasing in IntelliJ IDEA

In $IDEA_HOME/bin/idea64.vmoptions (or $IDEA_HOME/bin/idea.vmoptions on a x86 architecture), change

@kenjisato
kenjisato / keynote_export.applescript
Last active April 23, 2024 12:09
Script to Export Keynote Presentation Files to PDF or JPEG
on sansExt(theFileName)
do shell script "file=" & theFileName & ";" & "echo ${file%.*}"
end sansExt
on getExt(theFileName)
do shell script "file=" & theFileName & ";" & "echo ${file##*.}"
end getExt
on run argv
set keynote_path to (item 1 of argv)